Configuration.IsRunable 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.
Returns whether the project or project item configuration can be run.
public:
property bool IsRunable { bool get(); };
public:
property bool IsRunable { bool get(); };
[System.Runtime.InteropServices.DispId(9)]
public bool IsRunable { [System.Runtime.InteropServices.DispId(9)] get; }
[<System.Runtime.InteropServices.DispId(9)>]
[<get: System.Runtime.InteropServices.DispId(9)>]
member this.IsRunable : bool
Public ReadOnly Property IsRunable As Boolean
Property Value
A Boolean value indicating true
if a project or project item can be run, 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 can be run.
MessageBox.Show(config.IsRunable.ToString());
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Remarks
If it can be run, then you can specify it in the SolutionBuild object's StartupProjects property if it is a project.