19 March 2014

Solution version number accross multiple projects


On this post, I wanted to talk about version number. Most of our solution contains multiple projects and modifying the version number on multiple project is never the great.




So one of the solution could be to have a SharedAssemblyInfoFile which will be used across all the projects.

To do that, the first thing will be to create a File SharedAssemblyInfo.cs file on your main project - the project containing your sitecore files: Views...


Here is the content of the SharedAssemblyInfoFile:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyCompany("My Company")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
// 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 Revision and Build Numbers 
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.0.0.1")]
[assembly: AssemblyFileVersion("0.0.0.1")]

You can then create a link to an exsiting item for all the other project:

 When adding the existing item, do not forget to select add as link:


Once added, you can move the .cs into the property folder:






Now all your project assembly number will be updated in noe place under your main project...



No comments:

Post a Comment