共用方式為


VCAssemblyReference.BuildNumber 屬性

取得參考的組件的組建編號。

命名空間:  Microsoft.VisualStudio.VCProjectEngine
組件:  Microsoft.VisualStudio.VCProjectEngine (在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

語法

'宣告
ReadOnly Property BuildNumber As Integer
int BuildNumber { get; }
property int BuildNumber {
    int get ();
}
abstract BuildNumber : int with get
function get BuildNumber () : int

屬性值

型別:System.Int32
Int 值,表示參考的組件的組建編號。

備註

如需如何編譯與執行此範例的詳細資訊,請參閱HOW TO:編譯專案模型擴充性的範例程式碼

範例

' Add a reference to Microsoft.VisualStudio.VCProjectEngine.
' This example displays the build number of every file referenced in a
' Visual C++ project. Therefore, make sure you have a Visual C++ 
' project loaded before running this code.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module2
    Sub Test()
        Dim proj As Project
        Dim vcproj As VCProject
        Dim ref As VCReference

        On Error Resume Next

        ' Loop each project in the solution.
        For Each proj In DTE.Solution.Projects
            vcproj = Nothing
            vcproj = CType(proj.Object, VCProject)
            ' If this is a Visual C++ project.
            If Not vcproj Is Nothing Then
                ' Loop each reference in the Visual C++ project.
                For Each ref In vcproj.VCReferences
                    MsgBox("The build number for the file referenced by  _
                      '" & ref.Name & "' is '" & ref.BuildNumber & "'.")
                Next
            End If
        Next
    End Sub
End Module

.NET Framework 安全性

請參閱

參考

VCAssemblyReference 介面

Microsoft.VisualStudio.VCProjectEngine 命名空間