Export (0) Print
Expand All
Expand Minimize

ExcludedFromBuild Property

Visual Studio .NET 2003

Specifies whether this item is excluded from the build.

[Visual Basic .NET]
Public Property ExcludedFromBuild() As Boolean
[Visual Basic 6]
Property Get ExcludedFromBuild() As Boolean
Property Let ExcludedFromBuild( _
   ByVal NewValue As Boolean _
) 
[C++]
HRESULT __stdcall get_ExcludedFromBuild(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
HRESULT __stdcall put_ExcludedFromBuild(
   /* [in] */ VARIANT_BOOL NewValue
);
[C#]
public bool ExcludedFromBuild {get; set;}
[JScript .NET]
public function get ExcludedFromBuild() : Boolean
public function set ExcludedFromBuild(
   NewValue : Boolean
)

Remarks

See the General Property Page (File) for information on accessing ExcludedFromBuild for a file from the development environment.

See Specifying Build Events for information on accessing ExcludedFromBuild for a build event from the development environment.

ExcludedFromBuild specifies whether or not deployment occurs when the project is built. Set to True to disable deployment or set to False to enable deployment. See Web Deployment Property Page for information on accessing this property from the development environment.

Example

The following sample code modifies the VCPreLinkEventTool object's ExcludedFromBuild property in the development environment:

' 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

The following sample shows how to use ExcludedFromBuild on a VCFileConfiguration object.

' 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

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCFileConfiguration Object | VCPostBuildEventTool Object | VCPreBuildEventTool Object | VCPreLinkEventTool Object | VCReferenceConfiguration Object | VCWebDeploymentTool Object

Show:
© 2014 Microsoft