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?
Assembly informational versionThe text-based informational version corresponds to the product's marketing literature, packaging, or product name and is not used by the runtime. For example, an informational version could be "Common Language Runtime version 1.0" or "NET Control SP 2".
You can set the assembly version using the AssemblyVersionAttribute. Assembly attributes are usually applied in the AssemblyInfo.
It's the version number used by framework during build and at runtime to locate, link, and load the assemblies. When you add reference to any assembly in your project, it's this version number that gets embedded.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With