Configuration.IsBuildable Property

Gets whether the project or project item configuration can be built.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
ReadOnly Property IsBuildable As Boolean
bool IsBuildable { get; }
property bool IsBuildable {
    bool get ();
}
abstract IsBuildable : bool with get
function get IsBuildable () : boolean

Property Value

Type: System.Boolean
A Boolean value indicating true if a project or project item should be built, false if not.

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.

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);
    }
}

.NET Framework Security

See Also

Reference

Configuration Interface

EnvDTE Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples