Configuration.IsBuildable Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets whether the project or project item configuration can be built.
public:
property bool IsBuildable { bool get(); };
public:
property bool IsBuildable { bool get(); };
[System.Runtime.InteropServices.DispId(8)]
public bool IsBuildable { [System.Runtime.InteropServices.DispId(8)] get; }
[<System.Runtime.InteropServices.DispId(8)>]
[<get: System.Runtime.InteropServices.DispId(8)>]
member this.IsBuildable : bool
Public ReadOnly Property IsBuildable As Boolean
Property Value
A Boolean value indicating true
if a project or project item should be built, false
if not.
- Attributes
Examples
public void CodeExample(DTE2 dte, AddIn addin)
{ // Make sure you have a solution loaded into Visual Studio
// before running the following example.
try
{
Project prj;
Configuration config;
if (dte.Solution.Projects.Count > 0)
{
prj = dte.Solution.Projects.Item(1);
config = prj.ConfigurationManager.ActiveConfiguration;
// Determine and show whether the active configuration is buildable.
MessageBox.Show(config.IsBuildable.ToString());
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Remarks
To indicate whether a project or item should be built, specify it in a SolutionContext as the configuration that has context and builds for a given solution configuration.