Project.ConfigurationManager 属性
获取此 Project 的 ConfigurationManager 对象。
命名空间: EnvDTE
程序集: EnvDTE(在 EnvDTE.dll 中)
语法
声明
ReadOnly Property ConfigurationManager As ConfigurationManager
ConfigurationManager ConfigurationManager { get; }
property ConfigurationManager^ ConfigurationManager {
ConfigurationManager^ get ();
}
abstract ConfigurationManager : ConfigurationManager
function get ConfigurationManager () : ConfigurationManager
属性值
类型:EnvDTE.ConfigurationManager
ConfigurationManager 对象。
备注
ConfigurationManager 对象表示一个项目或项目项的项目配置。 项目配置名和平台名唯一标识每个项目配置。
示例
Sub ConfigurationManagerExample(ByVal dte As DTE2)
' Before running this sample, open a project.
Dim proj As Project = dte.Solution.Item(1)
Dim manager As ConfigurationManager = proj.ConfigurationManager
' Define a new Debug-based configuration for the project.
Dim configs As Configurations = _
manager.AddConfigurationRow("MyDebug", "Debug", False)
Dim config As EnvDTE.Configuration
Dim msg As String
' List all build configurations for the project.
For Each config In configs
msg &= config.ConfigurationName
Next
MsgBox(proj.Name & " defines the following build configurations:" _
& vbCrLf & vbCrLf & msg)
End Sub
public void ConfigurationManagerExample(DTE2 dte)
{
// Before running this sample, open a project.
Project proj = dte.Solution.Item(1);
ConfigurationManager manager = proj.ConfigurationManager;
// Define a new Debug-based configuration for the project.
Configurations configs =
manager.AddConfigurationRow("MyDebug", "Debug", false);
string msg = "";
// List all build configurations for the project.
foreach (EnvDTE.Configuration config in configs)
msg += config.ConfigurationName;
MessageBox.Show(proj.Name +
" defines the following build configurations:\n\n" + msg);
}
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。