Reputation: 24382
I've got a rather large solution in Visual Studio. Is there a way to update the Major / Minor version numbers for all the assemblies in the solution in one go?
Upvotes: 31
Views: 12643
Reputation: 1
Also you can create some "core" assembly and add into each your assembly reference to "core" assembly. "core" assembly will constaint constant. In this case in each Assembly info file will be set asembly version from "core" constant. For example:
"core" assembly has file Ver.cs with constant: public const string Value = "0.0.0.99";
in each solution assembly info will: [assembly: AssemblyFileVersion(Ver.Value)]
Upvotes: 0
Reputation: 164291
You can also have a public const string in one of your classes, that represents the build number, and use it in all your AssemblyInfo.cs for the different projects. Of course this would have to be in a project that are referenced by all the other projects, in order to work.
It is a good option, if you don't like the idea to reference the same AssemblyInfo.cs in all your projects.
Edit: Note! This also works when you use multiple languages (F# and C# in my case).
Upvotes: 10
There is a very useful utility I used some time ago on a project which required highly managed versioning:
http://www.codeproject.com/KB/macros/versioningcontrolledbuild.aspx
Upvotes: 1
Reputation: 3060
We have a single AssemblyInfoCommon.cs which has the version numbers, and is included in each project by reference. The other AssemblyInfo.cs files remain but only contain the assembly-specific information (title and description). So we only have one file to update for every C# project.
Upvotes: 11
Reputation: 2295
You can share an AssemblyInfo.cs file between all projects in the solution. This shared file should contain the version numbers. To share it, you must use Add Existing File in VS and select Add as Link in the file dialog. Every project has its private and the shared AssemblyInfo.cs. The private one still contains the non-Version attributes.
I've got a TeamCity setup, where I'm generating the shared file in each TeamCity build using the actual build version and it works beautifully.
Upvotes: 51
Reputation: 391336
Search/Replace?
The version numbers are stored in text-files after all (AssemblyInfo.cs under the Properties folder for each project).
Upvotes: 4