tags:

views:

34

answers:

2

Hello, I have a solution with many components and each component has its own version file (AssemblyInfo.cs). Currently each file as the standard structure:

[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

I would like to use the file version as the component version and keep that independent but I would like to have the "Product Version" be the same for all the components. I would like to do that by having a file at the solution level that is used by all the projects to get that version embedded.

Any suggestions Thanks Tony

+1  A: 

Well, simply put AssemblyVersion in a file shared by all projects, and AssemblyFileVersion - in the project-local file.

Or do I misunderstand the question?

Fyodor Soikin
I use a similar approach. Note that to "share" a file among projects, do an `Add Existing Item`, browse to the file, and then select `Add As Link` from the little arrow on the right side of the button.
Stephen Cleary
That is what I am trying to do but I get the error: AssemblyVersion no found
tony
I got it to compile but it is not showing the new version. I moved the AssemblyVersion to a new file and added a link but the assemblies shows the File version for both File and Product.
tony
I just found this comment somewhere else:If you're not signing your assemblies, assembly version numbers don'tmatter to the compiler, they're ignored. Is that what I am seeing here?
tony
Yes, it is what you're seeing.
Fyodor Soikin
A: 

That's the way we do it. We have a solution wide file defining a global assemblyVersion and include by link in each subproject and a project file defining assemblyFileVersion in each project.

If you want to automatically update the version you could use '1.0.*' syntax.

madgnome