_dispVCProjectEngineEvents.ProjectBuildFinished Method (Object, Int32, Int32, Boolean)
This API supports the product infrastructure and is not intended to be used directly from your code.
Signifies that the building of a project has been completed.
Assembly: Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)
Builds invoked by an automation program, or by the Visual Studio integrated development environment (IDE), are normally background processes.is helpful because it causes your program to pause execution until the build that was started by your program is finished.
' add reference to Microsoft.VisualStudio.VCProjectEngine Imports EnvDTE Imports Microsoft.VisualStudio.VCProjectEngine Public Module Module1 Sub ProjectBuildFinished(ByVal Cfg As Object, _ ByVal Warnings As Integer, ByVal errors As Integer, _ ByVal Canceled As Boolean) MsgBox(Warnings) End Sub Sub Main() Dim projEngine As VCProjectEngine Dim prj As VCProject Dim evt As VCProjectEngineEvents Dim cfgs As IVCCollection Dim cfg As VCConfiguration prj = DTE.Solution.Projects.Item(1).Object projEngine = prj.VCProjectEngine evt = projEngine.Events AddHandler evt.ProjectBuildFinished, AddressOf ProjectBuildFinished cfgs = prj.Configurations cfg = cfgs.Item(1) cfg.Build() End Sub End Module