7

When creating a new Solution in Visual Studio 2013, the top of the file looks like:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30110.0

Is this Format Version incorrect? VS2012 (v11) had a Format Version of 12.00, so why has Visual Studio 2013 (v12) not got a Format Version of 13.00?

This is causing issue with our build server because, according to this article (See #2):

http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx

The MSBuild VisualStudioVersion variable gets set using -1 the Format Version. Our build server only has VS2013 and associated tools (therefore installed in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0) but the build fails because the VisualStudioVersion is set automatically set to 11 and it looks in the wrong path (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0)

Am I missing something or should the Format Version have been incremented with Visual Studio 2013?

oatsoda
  • 2,088
  • 2
  • 26
  • 49

1 Answers1

12

The format version for Visual Studio 2013 is 12.0. If you have a build server that is not TFS2013, add in your build definition the following MSBuild Argument:

/p:VisualStudioVersion=12.0

More on the /property: switch aka /p: switch for MSBuild, here

You can also use hyphen instead of slash, if that is your preference; the behavior is the same:

-p:VisualStudioVersion=12.0`
Nate Anderson
  • 18,334
  • 18
  • 100
  • 135
LockTar
  • 5,364
  • 3
  • 46
  • 72
  • I think that's what I said in my question! But 12.0 is also the format version of VS 2012! Thanks, I did fix my issue with this parameter already to force it. – oatsoda Jul 23 '14 at 10:36
  • Your right, 12.0 is also the same format version as VS2012 and VS2013. But the parameter looks to the Visual Studio version. For VS2012 is that 11.0 and for VS2013 is that 12.0. I'm glad it helped. Don't forget to mark the answer. – LockTar Jul 23 '14 at 10:54
  • I was already using the parameter as a workaround. My question is more about finding out if this Format Version is an oversight or if there is a way of making it work - I don't like the fact that the build is no longer driven by the version within my solutions. – oatsoda Jul 25 '14 at 08:55
  • 1
    Well I think it never did. See in the workflow templates that there is a property with hardcoded the version number. The parameter just overwrites this version. – LockTar Jul 25 '14 at 10:57
  • 1
    That's not the case. I think you need to read the link in my question: "when you are building a .sln file the value of VisulStudioVersion will be –1 of the Format Version found in the .sln file." – oatsoda Jul 25 '14 at 12:36
  • @Ralph-Jansen is talking about the build workflow template (usually DefaultTemplate.11.1.xaml for TFS 2012). Buried in that workflow is a call to MSBuild, which supplies the version number. The statement "when you are building a .sln file..." refers to building from Visual Studio on your desktop. TFS 2013 supplied a new build template named TfvcTemplate.12.xaml. If you don't upgrade to the new template, you need to use the workaround that you've been using, or modify your older template. – JamesQMurphy Sep 19 '14 at 21:00