Share via


ConfigurationManager.PlatformNames 属性

获取所有可用平台的列表。

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

语法

声明
ReadOnly Property PlatformNames As Object
Object PlatformNames { get; }
property Object^ PlatformNames {
    Object^ get ();
}
abstract PlatformNames : Object with get
function get PlatformNames () : Object

属性值

类型:Object
一个对象。

备注

该列表包括具有与此 ConfigurationManager 对象关联的项目的生成设置的所有平台名。

示例

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have a solution loaded into Visual Studio
    // before running the following example.
    try
    {
        ConfigurationManager configmgr;
        Array arrayPN;
        if (dte.Solution.Projects.Count > 0)
        {
            configmgr = dte.Solution.Projects.Item(1).ConfigurationManager;

            // Show all available platforms.
            arrayPN = (Array)configmgr.PlatformNames;
            string pfnames = "Platform Names: \n";
            foreach (string p in arrayPN)
                pfnames = pfnames + p + "\n";
            MessageBox.Show(pfnames);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 安全性

请参阅

参考

ConfigurationManager 接口

EnvDTE 命名空间