Version Numbering for Visual Basic 6.0 Users
The version numbering scheme for Visual Basic 2005 differs from that used in Visual Basic 6.0, and the methods for setting and retrieving version numbers differ as well.
In Visual Basic 6.0, setting the Major, Minor, and Revision properties of the App object control the version number for an application. For example, setting Major to 1, Minor to 2, and Revision to 3 results in a version number of 22.214.171.124. The third part of the version number (0) cannot be seen in Visual Basic; however it is visible when you look at the properties of a file compiled by Visual Basic 6.0.
In Visual Basic 2005, the version-number properties are replaced by an AssemblyVersion attribute, which has four parts: Major, Minor, Build, and Revision. For the above example, the resulting version number would be 1.2.x.4, where x is the build number. Note that the Revision value is now the fourth part of the version number.
Setting Version Properties
In Visual Basic 6.0, version-number properties are set in the Project Properties dialog box; in Visual Basic 2005 they are set in the Assembly Information dialog box, available by clicking the Assembly Information button on the Application tab of the Project Designer.
Visual Basic 6.0 version-number properties are stored in the Project (.vbp) file and can also be edited directly using a text editor such as Notepad. Assembly attributes are stored in the AssemblyInfo.vb file and can also be edited directly in the Code Editor.
Code Changes for Version Numbering
The following code example illustrates the differences in coding techniques between Visual Basic 6.0 and Visual Basic 2005.
Code Changes for Displaying an Application's Version Number
Version Number Property Equivalencies
The following table lists Visual Basic 6.0 version-number properties and their Visual Basic 2005 equivalents.
|Visual Basic 6.0||Visual Basic 2005|
When an application is upgraded from Visual Basic 6.0, only the Major and Minor properties are upgraded; Visual Basic 2005 assigns new values for the Revision and Build properties.