title: MSBuild in TeamCity of Visual Studio 2012 solution
body: <p>I have a VS 2012 web project /sln that I am trying to build in TeamCity. it uses .NET 4.5 which is installed on TeamCity.</p>
  
  <p>The TeamCity server has <strong>VS  2010 installed only</strong>.</p>
  
  <p>I get this error when the build runs:</p>
  
  <pre><code>C:\BuildAgent\work\d5bc4e1b8005d077\CUSAAdmin.Web\CUSAAdmin.Web.csproj(799, 3): 
  error MSB4019: 
  The imported project 
      "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. 
   Confirm that the path in the &lt;Import&gt; declaration is correct, and that the file exists on disk. Project CUSAAdmin.Web\CUSAAdmin.Web.csproj failed. 
   Project CUSAAdmin.sln failed. 
  </code></pre>
  
  <p>It is trying to use Visual Studio 2012 (v11.0) to build. </p>
  
  <p>I have set the <strong>VisualStudioVersion</strong> to be <strong>10</strong> in the <strong>build.xml</strong> though??</p>
  
  <pre><code> &lt;Target Name="BuildPackage"&gt;
     &lt;MSBuild Projects="CUSAAdmin.sln" ContinueOnError="false" 
       Targets="Rebuild" 
        Properties="Configuration=$(Configuration); VisualStudioVersion=10.0"  /&gt;
  </code></pre>
  
  <p>As well inside the project it is defaulting to VS2010</p>
  
  <pre><code>  &lt;PropertyGroup&gt;
  &lt;VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''"&gt;10.0&lt;/VisualStudioVersion&gt;
  &lt;VSToolsPath 
      Condition="'$(VSToolsPath)' == ''"&gt;$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)&lt;/VSToolsPath&gt;
  </code></pre>