Assembly Version Number

Every assembly has a version number. That number applies to all components (potentially across multiple modules) in the assembly. You typically specify the version number in the Visual Studio 2005 project settings, although you can also assign a version number during the link phase, using command-line utilities and switches or MSBuild.

To specify the version number using Visual Studio 2005, bring up the assembly properties, and open the Application tab. Click the Assembly Information button to display the Assembly Information dialog (see Figure 5-1).

Specify the assembly version in the Assembly Information dialog

Figure 5-1. Specify the assembly version in the Assembly Information dialog

Next to Assembly Version are four text boxes used to specify the assembly version. The Assembly Information dialog is merely a visual editor for a set of assembly attributes. These attributes are stored in the project’s AssemblyInfo.cs file. The attribute used for the assembly version is AssemblyVersion. For example, the AssemblyVersion value corresponding to the settings in is:

    [assembly: AssemblyVersion("1.2.3.4")]

The version number is recorded in the server assembly manifest. When a client developer adds a reference to the server assembly, the client assembly records in its manifest the name and the exact version of the server assembly against which it was compiled. If the client uses the class MyClass from version 1.2.3.4 of the assembly ...

Get Programming .NET Components, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.