views:

424

answers:

2

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:

alt text

Project with injected global assembly info:

alt text

Yauheni Sivukha
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
Can you show contents of your global AssemblyInfo file?
Yauheni Sivukha
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
It's obvious - you have the same attribute in global and local AssemblyInfo file and compiler do not accept this!
Yauheni Sivukha