What approaches have you taken to coordinating changes to version and Copyright for groups of assemblies?
I have a tree of many csprojs each with its own AssemblyInfo file. As part of my build process I want to set copyright year and version. It looks like the following options be be available but file modification is the only one I’ve seen thus far:
- Modify all files via script
- Include resource with date (a macro, a singleton class with public static variables)
- Override AssemblyVersion on command line ( -DAssemblyVersion=”1.0.0.1″ ?)
- Reference Environment variable (
[assembly: AssemblyFileVersion("${ENV.VERSION")])
I’m used to keeping the source tree clean of generated files in Java/C++ via command line params, defines and centralizing all version specification in a single file.
What approach to do you use to keep the versions in sync and manageable?
Thanks
Peter
In the top folder, I place a CommonAssemblyInfo.cs that contains the … common stuff, such as copyright and FileVersion. This file is just contains some default attributes and is regenerated by a script(a simple .bat file) on the build server, Hudson in my case. Remove these common attributes in each of the projects AssemblyInfo.cs.
In each project in the solution, I add this file. but use “Add as link” – available in the drop down of the “Add” button when you add an existing file. i.e. all projects just contains a reference to the same file, so there’s only one file to update.