Freigeben über


VCConfiguration.BuildWithProperty Method

Definition

Begins an asynchronous build with a given property set to some value beyond what is defined in the project file.

public:
 void BuildWithProperty(Microsoft::VisualStudio::VCProjectEngine::bldActionTypes bldType, System::String ^ bstrPropertyName, System::String ^ bstrPropertyValue, Microsoft::VisualStudio::VCProjectEngine::IVCBuildCompleteCallback ^ callback);
public:
 void BuildWithProperty(Microsoft::VisualStudio::VCProjectEngine::bldActionTypes bldType, Platform::String ^ bstrPropertyName, Platform::String ^ bstrPropertyValue, Microsoft::VisualStudio::VCProjectEngine::IVCBuildCompleteCallback ^ callback);
void BuildWithProperty(Microsoft::VisualStudio::VCProjectEngine::bldActionTypes bldType, std::wstring const & bstrPropertyName, std::wstring const & bstrPropertyValue, Microsoft::VisualStudio::VCProjectEngine::IVCBuildCompleteCallback const & callback);
[System.Runtime.InteropServices.DispId(786)]
public void BuildWithProperty (Microsoft.VisualStudio.VCProjectEngine.bldActionTypes bldType, string bstrPropertyName, string bstrPropertyValue, Microsoft.VisualStudio.VCProjectEngine.IVCBuildCompleteCallback callback);
[<System.Runtime.InteropServices.DispId(786)>]
abstract member BuildWithProperty : Microsoft.VisualStudio.VCProjectEngine.bldActionTypes * string * string * Microsoft.VisualStudio.VCProjectEngine.IVCBuildCompleteCallback -> unit
Public Sub BuildWithProperty (bldType As bldActionTypes, bstrPropertyName As String, bstrPropertyValue As String, callback As IVCBuildCompleteCallback)

Parameters

bldType
bldActionTypes

One of the enumeration values that specifies the type of build to start.

bstrPropertyName
String

The name of an MSBuild global property to set on the project before the build starts.

bstrPropertyValue
String

A value to set on the property represented by the bstrPropertyName parameter.

callback
IVCBuildCompleteCallback

An optional callback function that is invoked when the build finishes; otherwise, null.

Attributes

Exceptions

This method is invoked on a VCConfiguration object that is not in the active solution configuration.

-or-

A build is already in progress.

Remarks

The build that is queued by this method might not appear on the build queue of the Solution Build Manager when this method exits. Callers that must wait for the build to complete should wait on a background thread until the callback function is called. This tactic avoids a deadlock on the main thread, which must pump messages to start the build.

The callback function, if provided, is called as soon as this VCConfiguration object finishes building, which might be before the solution build finishes. This can happen, for example, if other builds are also queued. The callback function is invoked on the main thread.

A VCConfiguration object can be built only if it is active given the currently active solution configuration.

Applies to