Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic assembly version number management in VS2008

I have a VS2008 project written in c# with a number of assemblies. I'd like to have a simple way of managing the version numbers between all of the different assemblies and a way to automatically increment the build number and have that saved into the version number of each assembly.

I'm guessing that this is a problem with most projects so presumably it has been solved before?

Any suggestions for how I can simplify management of my project's version resources?

like image 534
Jack Hughes Avatar asked Mar 04 '09 12:03

Jack Hughes


People also ask

Where is the version information stored of an assembly?

The version number is stored in the assembly manifest along with other identity information, including the assembly name and public key, as well as information on relationships and identities of other assemblies connected with the application.

How can you get the Assembly version in C#?

I can get the Assembly Version with the following line of code: Version version = Assembly.

How do I disable determinism for compilation?

You can either remove '*' from your version string, or disable determinism in your project file by setting the MSBuild property `<Deterministic>false</Deterministic>`.


1 Answers

I use a .cs file on solution level that is linked by all projects in the solution which contains the following lines:

using System.Reflection;
[assembly : AssemblyVersion("1.2.3.*")]

And be sure to remove the AssemblyFileVersion attribute from the AssemblyInfo file in your project.

like image 138
Gerrie Schenck Avatar answered Sep 28 '22 23:09

Gerrie Schenck