1

Our Application is in the windows .Net with c#

We had 10-15 SubProjects which belong to one single project and we want to assign the Version Number for each of them(each dll which belongs to the Specific Sub- Project) through the common .cs file.

So that for each Build/Release we want to touch the single File instead of the 10 AssemblyInfo.cs files

jay
  • 27
  • 6
  • I've used this method before https://blogs.msdn.microsoft.com/jjameson/2009/04/03/shared-assembly-info-in-visual-studio-projects/ – Bradley Uffner May 06 '16 at 19:28
  • Hi @Bradley Uffner, thanks for the answer But in my case my **Sub-Projects need to be with Different VersionNumbers**, as at the time of build all those SubProjects need to access there version numbers from the same file.. If you suggest any thing that would be helpful, Thanks – jay May 09 '16 at 16:58

1 Answers1

1

Look at GlobalAssemblyInfo.cs You can 'Add as a link' to each project. The Version will be defined only on the GlobalAssemblyInfo.cs

here you can find more info

Community
  • 1
  • 1
Bruno Garcia
  • 6,029
  • 3
  • 25
  • 38
  • Hi @Bruno Garcia, thanks for the answer But in my case my **Sub-Projects need to be with Different VersionNumbers**, but at the time of build all those SubProjects need to access there version numbers from the same file.. If you suggest any thing that would be helpful, Thanks – jay May 09 '16 at 16:53
  • In that case each project will require its own `AssemblyInfo.cs`. You could use a build step that reads from this 'same' file and patches each project individually. Honestly, it seems like a complicated workflow. It's easier in this case to manager Major and Minor version directly on each project (AssemblyInfo.cs) individually and let the build server add the revision/patch number. – Bruno Garcia May 09 '16 at 17:43