Wednesday, 12 October 2011

Versioning Visual Studio 2010 Solution using Nant

Creating an automated versioning functionality for a particular project may be straight forward, but often you’d want all projects in the solution to share the same version number without having to author each project’s “Assembly.cs”. If update fails for any of the projects, the solution will be left in an inconsistent state version-wise.

The solution to this is to create a common assembly file and link it to each project in the solution. Then any update to the parent common assembly will ripple through to all projects.

  • Create a solution folder and add an assembly file, namely “CommonAssembly.cs”.


  • For each project add the “CommonAssembly.cs” file AS A LINK, by right-clicking the project, Add, Existing Item.


  • Note the icon on the newly added file link.



  • Now add a Nant target to update the “CommonAssembly.cs” parent file at build time.

No comments:

Post a Comment