12

Every now and then our source control engine indicates that the ProductVersion in a .csproj file has changed. We're using VS2008 SP1.

Looking through the codebase I can see two versions reported:

<ProductVersion>9.0.30729</ProductVersion>

and

<ProductVersion>9.0.21022</ProductVersion>

Does anyone know why and when Visual Studio decides to change this setting, and to what these two version numbers refer?

Richard Ev
  • 52,939
  • 59
  • 191
  • 278
  • 2
    I'm getting this too. It only happens when the other developer on my team commits something. I assume he's got a slightly different configuration for Visual Studio. Googling indicates it has something to do with Silverlight (which we don't use, but one of us might have installed the tools), but I don't know what the fix is yet. – Tom Bushell Oct 26 '11 at 19:52

1 Answers1

9

That's the version of Visual Studio used to load the .csproj, so it knows what capabilities the project might contain (if new versions of VS change the format of the proj file).

It will change when the project is loaded - VS is silently doing a minor 'upgrade' to the project file.

Look at a VS2005 proj file, you'll see the ProjectVersion is set to 8.0.xxx

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
  • Sure, however I've opened all of these .csproj files on my machine, but only some have the higher version number. – Richard Ev Aug 19 '09 at 12:12
  • 1
    what about after you save them? I wonder if they only get saved in certain circumstances - you modify the settings or the file list. – gbjbaanb Aug 19 '09 at 12:57
  • Looks like the setting only gets refreshed if you add/remove a file or reference to the project. – Richard Ev Sep 07 '09 at 12:43
  • Clearly the answer doesn't answer the actual question, right? I see VS updating the ProductVersion from 30729 to 21022, that means it resets the version to a number it knows. – Vin Feb 07 '11 at 15:40
  • 2
    How is my answer not correct? VS changes it depending on what version of VS it is, and it doe is at project load time. – gbjbaanb Apr 09 '12 at 11:57
  • I guess this version surely changes Visual Studio Service Packs. Now VS 2012 is at Update 2. – Csaba Toth Apr 24 '13 at 18:58
  • To gain a full understanding please refer to: http://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin – 27k1 May 03 '13 at 07:47
  • 2
    @peteringermany AssemblyVersion has absolutely nothing to do with the ProductVersion setting in the csproj. – SWalters May 22 '13 at 00:12
  • I just checked this against a new Visual Studio 2010 class library project, and it also had a `ProjectVersion` of 8. – Sam Aug 26 '13 at 00:06