Configuration.IsRunable Property

Returns whether the project or project item configuration can be run.

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

Syntax

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

Property Value

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

Remarks

If it can be run, then you can specify it in the SolutionBuild object's StartupProjects property if it is a project.

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 can be run.
            MessageBox.Show(config.IsRunable.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