I have written a DLL in C# using VS2005.
Currently the DLL is showing a version number of 1.0.0.0.
How do I set this version number to something different?
I have written a DLL in C# using VS2005.
Currently the DLL is showing a version number of 1.0.0.0.
How do I set this version number to something different?
look in the AssemblyInfo.cs file for the following line, and set it to whatever version number you want:
[assembly: AssemblyVersion("1.0.0.0")]
Alter this line in AssemblyInfo.cs:
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.9.10292.8")]
You can set the version number in AssemblyInfo.cs
.
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Note that the assembly version is not the same as the assembly file version. From your brief description it sounds more like you are looking for the latter - AssemblyFileVersion
.
You can either specify the file version using the AssemblyFileVersionAttribute directly...
Instructs a compiler to use a specific version number for the Win32 file version resource.
...or you can remove this attribute entirely which will mean that the file version defaults to the assembly version. This is probably good practice as having a file version that is different to the assembly version will cause confusion.
If the AssemblyFileVersionAttribute is not supplied, the AssemblyVersionAttribute is used for the Win32 file version that is displayed on the Version tab of the Windows file properties dialog.
You can set the assembly version using the AssemblyVersionAttribute.
Assembly attributes are usually applied in the AssemblyInfo.cs file as stated in the other answers.
Right click the project and click properties. The properties window will appear. In that click Application tab. It will show application information of the project. There will be a button named Assembly Information. click the button, it will show you a form containing assembly information of the project. You can specify the assembly version (contains four text boxes, i.e., Major Version, Minor Version, Build Number, Revision). It will store the assembly details in AssemblyInfo.cs of the corresponding project.