Tip: Shared Assembly Attribute File

When you on a solution with several assmblies in .NET, you’ll find yourself maintaining multiple copies of AssemlyInfo.cs, each of which contain a lot of common attributes such as:

You may also wish to make AssemblyVersion uniform accross your build.

A useful technique in this situation is the following:
1. Copy the common attributes out into a new file, called something like ‘GlobalAssemblyInfo.cs’
2. Delete these common attributes from the original AssemblyInfo.cs files
3. Save your GlobalAssemblyInfo.cs file somewhere useful, e.g. in the same folder as your solution file
4. In each project, add GlobalAssmblyInfo.cs through the IDE as a linked file, rather than a straight addition.

Leave a Reply

Your email address will not be published. Required fields are marked *