VCAssemblyReference.BuildNumber 属性

定义

获取已引用程序集的内部版本号。

public:
 property int BuildNumber { int get(); };
public:
 property int BuildNumber { int get(); };
[System.Runtime.InteropServices.DispId(2012)]
public int BuildNumber { [System.Runtime.InteropServices.DispId(2012)] get; }
[<System.Runtime.InteropServices.DispId(2012)>]
[<get: System.Runtime.InteropServices.DispId(2012)>]
member this.BuildNumber : int
Public ReadOnly Property BuildNumber As Integer

属性值

Int32

一个整数值,表示已引用程序集的内部版本号。

实现

属性

示例

' 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  

注解

有关如何编译和运行此示例的信息,请参阅 如何:编译项目模型扩展性的示例代码

适用于