获取或设置一个值,该值指示是否从生成中排除此项。
命名空间: Microsoft.VisualStudio.VCProject
程序集: Microsoft.VisualStudio.VCProject(在 Microsoft.VisualStudio.VCProject.dll 中)
语法
声明
Property ExcludedFromBuild As Boolean
bool ExcludedFromBuild { get; set; }
property bool ExcludedFromBuild {
bool get ();
void set (bool value);
}
abstract ExcludedFromBuild : bool with get, set
function get ExcludedFromBuild () : boolean
function set ExcludedFromBuild (value : boolean)
属性值
类型:System.Boolean
如果从生成中排除此项,则为 true;否则为 false。
备注
有关访问 ExcludedFromBuild 的信息为文件从开发环境,请参见 “常规”属性页(文件) 。
有关访问 ExcludedFromBuild 的信息用于生成事件从开发环境,请参见 指定生成事件 。
ExcludedFromBuild 指定部署是否发生,在项目生成时。设置为 true 禁用部署或将其设置为 false 启用部署。有关如何编译和运行此示例的信息,请参见 如何:编译项目模型扩展性示例代码 。
示例
[Visual Basic]
下面的代码示例在开发环境中修改 VCPreLinkEventTool 对象的 ExcludedFromBuild 属性:
' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
Sub Test()
Dim prj As VCProject
Dim cfgs, tools As IVCCollection
Dim cfg As VCConfiguration
Dim tool As VCPostBuildEventTool
prj = DTE.Solution.Projects.Item(1).Object
cfgs = prj.Configurations
cfg = cfgs.Item(1)
tool = cfg.Tools("VCPreLinkEventTool")
tool.ExcludedFromBuild = False
End Sub
End Module
下面的示例演示如何使用在 VCFileConfiguration 对象的 ExcludedFromBuild 。
' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
Sub Test()
Dim file As VCFile
Dim col As IVCCollection
Dim fileconfig As VCFileConfiguration
Dim prj As VCProject
prj = DTE.Solution.Projects.Item(1).Object
col = prj.Files
file = col.Item("project6.cpp")
col = file.FileConfigurations
fileconfig = col.Item(1)
fileconfig.ExcludedFromBuild = True
End Sub
End Module
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。