共用方式為


VSProject2.BuildManager 屬性

取得 VSProjectBuildManager 物件。

命名空間:  VSLangProj80
組件:  VSLangProj80 (在 VSLangProj80.dll 中)

語法

'宣告
ReadOnly Property BuildManager As BuildManager
    Get
BuildManager BuildManager { get; }
property BuildManager^ BuildManager {
    BuildManager^ get ();
}
abstract BuildManager : BuildManager
function get BuildManager () : BuildManager

屬性值

型別:VSLangProj.BuildManager
BuildManager 物件。

實作

VSProject.BuildManager

備註

協力廠商開發人員使用 BuildManager 屬性管理由執行自訂工具所產生的可移植執行檔。 如需詳細資訊,請參閱BuildManagerEvents

範例

若要將此範例當做增益集來執行,請參閱 HOW TO:編譯和執行 Automation 物件模型程式碼範例。 開啟 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());
}

.NET Framework 安全性

請參閱

參考

VSProject2 介面

BuildManager 多載

VSLangProj80 命名空間

BuildManager