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
)

参数

  • bstrPropertyName
    类型:String

    要在启动生成之前对项目设置的 MSBuild 全局属性的名称。

  • bstrPropertyValue
    类型:String

    要对 bstrPropertyName 参数所表示的属性设置的值。

异常

异常 条件
InvalidOperationException

在不在活动解决方案配置中的 VCConfiguration 对象上调用此方法。

- 或 -

生成已经在进行中。

备注

此方法已排队的生成可能不会显示在解决方案生成经理的生成进行排队,当此方法退出时。 必须等待生成完成的调用方在后台线程应等待,在回调函数调用。 避免此策略在主线程中发生死锁,必须发送消息启动生成。

回调函数,即,如果,假定,调用,当 VCConfiguration 对象完成生成,可能是,在解决方案生成中、已完成。 如果其他版本还队列,例如,就可能发生这种情况。 回调函数在主线程调用。

它才能是一个活动当前活动的解决方案配置,VCConfiguration 进行生成。

.NET Framework 安全性

请参阅

参考

VCConfiguration 接口

Microsoft.VisualStudio.VCProjectEngine 命名空间