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
    类型:System.String
    要在启动生成之前对项目设置的 MSBuild 全局属性的名称。
  • bstrPropertyValue
    类型:System.String
    要对 bstrPropertyName 参数所表示的属性设置的值。

异常

异常 条件
InvalidOperationException

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

- 或 -

生成正在进行。

备注

此方法已排队的生成可能不会出现在解决方案生成管理器的生成队列,当此方法退出时。 必须等待生成完成时调用方在后台线程应该等待,直到回调函数调用。 此策略避免在主线程上一个死锁,必须发送消息开始生成。

回调函数,因此,如果,假定,调用,则此 VCConfiguration 对象完成生成,可能是,请在解决方案生成完成之前。 ,如果其他生成进行排队,,则会发生此错误。 回调函数在主线程调用。

,并且只能使用给定的活动当前活动的解决方案配置, VCConfiguration 对象可以生成。

.NET Framework 安全性

请参见

参考

VCConfiguration 接口

Microsoft.VisualStudio.VCProjectEngine 命名空间