VCConfiguration.BuildWithProperty 方法
將指定的屬性設定為非專案檔中定義的值,來開始非同步建置。
命名空間: Microsoft.VisualStudio.VCProjectEngine
組件: Microsoft.VisualStudio.VCProjectEngine (在 Microsoft.VisualStudio.VCProjectEngine.dll 中)
語法
'宣告
Sub BuildWithProperty ( _
bldType As bldActionTypes, _
bstrPropertyName As String, _
bstrPropertyValue As String, _
callback As IVCBuildCompleteCallback _
)
void BuildWithProperty(
bldActionTypes bldType,
string bstrPropertyName,
string bstrPropertyValue,
IVCBuildCompleteCallback callback
)
void BuildWithProperty(
[InAttribute] bldActionTypes bldType,
[InAttribute] String^ bstrPropertyName,
[InAttribute] String^ bstrPropertyValue,
[InAttribute] IVCBuildCompleteCallback^ callback
)
abstract BuildWithProperty :
bldType:bldActionTypes *
bstrPropertyName:string *
bstrPropertyValue:string *
callback:IVCBuildCompleteCallback -> unit
function BuildWithProperty(
bldType : bldActionTypes,
bstrPropertyName : String,
bstrPropertyValue : String,
callback : IVCBuildCompleteCallback
)
參數
bldType
類型:Microsoft.VisualStudio.VCProjectEngine.bldActionTypes一個列舉值,指定要啟動的建置類型。
bstrPropertyName
類型:String建置開始之前要在專案上設定的 MSBuild 全域屬性的名稱。
bstrPropertyValue
類型:String要在 bstrPropertyName 參數所表示的屬性上設定的值。
callback
類型:Microsoft.VisualStudio.VCProjectEngine.IVCBuildCompleteCallback建置完成時叫用的選擇性回呼函數;否則為 nullnull 參考 (即 Visual Basic 中的 Nothing)。
例外狀況
例外狀況 | 條件 |
---|---|
InvalidOperationException | 會在未位於作用中方案組態的 VCConfiguration 物件上叫用此方法。 -或- 已在進行建置。 |
備註
這個方法已佇列組建可能不會出現在方案建置管理員的組建佇列,這個方法結束時。 必須等候建置完成的呼叫端在背景執行緒必須等待,直到呼叫回呼函式。 這個策略避免在主執行緒的死結,必須提取訊息啟動組建。
回呼函式,則為,否則,假設,呼叫,當這個 VCConfiguration 物件完成建置,可能是,在方案建置完成。 如果其他組建排入佇列,也,就會發生這種情況。 回呼函式在主執行緒上被叫用。
其為指定之使用中目前使用中的方案組態, VCConfiguration 物件中建立。
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。