Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#: how to set version number of assembly

Tags:

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?

like image 373
Craig Johnston Avatar asked Oct 20 '10 07:10

Craig Johnston


2 Answers

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")] 
like image 105
Mark Heath Avatar answered Oct 25 '22 06:10

Mark Heath


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.

like image 40
Scott Munro Avatar answered Oct 25 '22 06:10

Scott Munro