Managing Assembly Version

 

Here is an elegant solution that requires a little work upfront when adding a new project but handles the process very easily.

 

The idea is that each project links to a Solution file that only contains the assembly version information.  So your build process only has to update a single file and all of the assembly versions pull from the one file upon compilation.

 

Steps:

1. Add a class to you solution file *.cs file, I named min SharedAssemblyProerties.cs

2. Remove all of the cs information from that new file

3. Cut the assembly information from an AssemblyInfo file:

[assembly: AssemblyVersion("1.0.0.0")]

[assembly: AssemblyFileVersion("1.0.0.0")]

4. Add the statement "using System.Reflection;" to the file and then paste data into your new cs file (ex SharedAssemblyProperties.cs)

5. Add an existing item to you project (wait... read on before adding the file)

6. Select the file and before you click Add, click the dropdown next to the add button and select "Add As Link".

 

7. Repeat steps 5 and 6 for all existing and new projects in the solution

 

When you add the file as a link, it stores the data in the project file and upon compilation pulls the assembly version information from this one file.

 

In you source control, you add a bat file or script file that simply increments the SharedAssemblyProperties.cs file and all of your projects will update their assembly information from that file.

 

thanks to Chuck Sailer for the information.

Published 02-04-2010 11:15 AM by Rob Sondles

Comments

# re: Managing Assembly Version

Tuesday, February 09, 2010 4:45 AM by Yan

Thanks for idea! This simplifies a lot of things.

# re: Managing Assembly Version

Tuesday, February 16, 2010 12:17 AM by kqsupd

UVH9hZ  <a href="mctupwksuobd.com/.../a>, [url=http://lbehdnvbsxih.com/]lbehdnvbsxih[/url], [link=http://qkslidgmoomo.com/]qkslidgmoomo[/link], http://npplemybwpfv.com/

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Powered by Community Server (Non-Commercial Edition), by Telligent Systems