Configuration.IsRunable 属性

返回是否可以运行项目或项目项配置。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

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

属性值

类型:System.Boolean
一个布尔值,如果可以运行项目或项目项,则为 true,否则为 false。

备注

如果可以运行它,则可以在 SolutionBuild 对象的 StartupProjects 属性中指定它(如果它是项目的话)。

示例

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 安全性

请参见

参考

Configuration 接口

EnvDTE 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例