共用方式為


VCProjectReference.majorVersion Property

Definition

Gets the major version of the referenced assembly.

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

Property Value

An int value representing the major version of the referenced assembly.

Implements

Attributes

Examples

See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.

The following example lists the value of the majorVersion property of the assembly reference:

' Add a reference to Microsoft.VisualStudio.VCProjectEngine and have a   
' Visual C++ project loaded before running this example.  
Imports EnvDTE  
Imports Microsoft.VisualStudio.VCProjectEngine  

Public Module Module1  
    Sub Test()  
        Dim prj As VCProject  
        Dim vcar As VCAssemblyReference  
        prj = DTE.Solution.Projects.Item(1).Object  
        vcar = prj.VCReferences.item(1)   
        MsgBox("Major version: " & vcar.MajorVersion)  
    End Sub  
End Module  

Applies to