VSProject2.BuildManager 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取的 BuildManager 对象 VSProject 。
public:
property VSLangProj::BuildManager ^ BuildManager { VSLangProj::BuildManager ^ get(); };
public:
property VSLangProj::BuildManager ^ BuildManager { VSLangProj::BuildManager ^ get(); };
[System.Runtime.InteropServices.DispId(2)]
public VSLangProj.BuildManager BuildManager { [System.Runtime.InteropServices.DispId(2)] get; }
[<System.Runtime.InteropServices.DispId(2)>]
[<get: System.Runtime.InteropServices.DispId(2)>]
member this.BuildManager : VSLangProj.BuildManager
Public ReadOnly Property BuildManager As BuildManager
属性值
BuildManager 对象。
实现
- 属性
示例
若要将此示例作为外接程序运行,请参阅 如何:编译和运行自动化对象模型代码示例。 Visual Basic Visual C# 运行此外接程序之前,请先打开或项目。
[Visual Basic]
Imports VSLangProj
Imports VSLangProj2
Imports VSLangProj80
Public Sub OnConnection(ByVal application As Object, _
ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
ByRef custom As Array) Implements IDTExtensibility2.OnConnection
applicationObject = CType(application, DTE2)
addInInstance = CType(addInInst, AddIn)
BuildManagerTest(applicationObject)
End Sub
Sub BuildManagerTest(ByVal dte As DTE2)
Dim aProject As Project
Dim aVSProject As VSProject2
aProject = applicationObject.Solution.Projects.Item(1)
MsgBox("Project kind is: " & aProject.Kind & vbCr _
& "Project name is: " & aProject.Name)
aVSProject = CType(applicationObject.Solution.Projects.Item(1) _
.Object, VSProject2)
MsgBox("The full name of the project is:" & vbCr _
& aVSProject.Project.FullName)
MsgBox("The BuildManager's containing project is: "_
& aVSProject.BuildManager.ContainingProject.Name)
MsgBox("The Buildmanager's design time output monikers type is:" _
& vbCr &_
aVSProject.BuildManager.DesignTimeOutputMonikers.GetType.ToString())
End Sub
[C#]
using System.Windows.Forms;
using VSLangProj;
using VSLangProj2;
using VSLangProj80;
public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
applicationObject = (DTE2)application;
addInInstance = (AddIn)addInInst;
BuildManagerTest((DTE2)applicationObject);
}
public void BuildManagerTest(DTE2 dte)
{
Project aProject = null;
VSProject2 aVSProject = null;
aProject = applicationObject.Solution.Projects.Item(1);
MessageBox.Show("Project kind is: " + aProject.Kind + "\n"
+ "Project name is: " + aProject.Name);
aVSProject = ((VSProject2)( applicationObject.Solution.Projects.Item(1).Object));
MessageBox.Show("The full name of the project is:" + "\n"
+ aVSProject.Project.FullName);
MessageBox.Show("The BuildManager's containing project is: "
+ aVSProject.BuildManager.ContainingProject.Name);
MessageBox.Show("The Buildmanager's design time output monikers
type is:" + "\n" +
aVSProject.BuildManager.DesignTimeOutputMonikers.GetType().ToString());
}
注解
BuildManager第三方开发人员使用该属性来管理运行自定义工具时生成的可移植可执行文件。 有关详细信息,请参阅 BuildManagerEvents。