Hi I have .NET 3.5 solution with multiple projects in it. Is there a way I can create a "Global" AssemblyInfo.cs in which all the project AssemblyInfo.cs can reference from?
+5
A:
yes, it is possible. Create AssemblyInfoInc.cs somewhere in the root of your solution, add global attributes there and add as link to each project.
Save dialog:
Project with injected global assembly info:
Yauheni Sivukha
2010-04-28 18:35:07
I tried following your instructions but I got the following error:"Error 28 An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type" when trying to call my global AssemblyInfo.cs in the project AssemblyInfo.
Petezah
2010-04-28 18:59:04
Can you show contents of your global AssemblyInfo file?
Yauheni Sivukha
2010-04-28 19:11:40
I actually have a new error now. I put the following into the root of my solution:"using System.Reflection;[assembly: AssemblyVersion("1.0.0.0")][assembly: AssemblyFileVersion("1.0.0.0")]"and I got the following errors:"Error 2 Duplicate 'AssemblyFileVersion' attribute Error 1 Duplicate 'AssemblyVersion' attribute"
Petezah
2010-04-28 20:01:42
It's obvious - you have the same attribute in global and local AssemblyInfo file and compiler do not accept this!
Yauheni Sivukha
2010-04-29 05:21:55
+1
A:
Here's an a walkthrough on linking it: http://cs.blueberryislandmedia.com/blogs/blueberries/archive/2010/02/04/managing-assembly-version.aspx
Courtesy of http://stackoverflow.com/users/185802/sondlerd
Mike Mooney
2010-04-28 18:48:58