VCProject.Version(Int32, Int32) 方法

定义

设置或返回项目的主版本号和次版本号。

public:
 void Version([Runtime::InteropServices::Out] int % major, [Runtime::InteropServices::Out] int % minor);
void Version([Runtime::InteropServices::Out] int & major, [Runtime::InteropServices::Out] int & minor);
[System.Runtime.InteropServices.DispId(854)]
public void Version (out int major, out int minor);
[<System.Runtime.InteropServices.DispId(854)>]
abstract member Version : int * int -> unit
Public Sub Version (ByRef major As Integer, ByRef minor As Integer)

参数

major
Int32

一个表示项目主版本号的整数。

minor
Int32

一个表示项目次版本号的整数。

属性

示例

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

' Add a reference to Microsoft.VisualStudio.VCProjectEngine before   
' running this example.  
Imports EnvDTE  
Imports Microsoft.VisualStudio.VCProjectEngine  

Public Module Module1  
    Sub Test()  
        Dim sln As Solution  
        Dim prj As VCProject  
        prj = DTE.Solution.Item(1).Object  
        prj.Version("4", "5")  
    End Sub  
End Module  

适用于