Skip to content

Instantly share code, notes, and snippets.

@thecodejunkie
Created March 21, 2013 12:16
Show Gist options
  • Save thecodejunkie/5212614 to your computer and use it in GitHub Desktop.
Save thecodejunkie/5212614 to your computer and use it in GitHub Desktop.
Help!
I don't have VS2012 installed on one of my machines, but .NET Framework 4.5 is. When creating a web project using VS2012 it instists on adding
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
To the csproj of said project. If I build these outside of VS (in this case using Rake) it will resolve VisualStudioVersion to v11.0, which means will try to look for targets at
"C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets"
which does not exist, so I end up with
Nancy.Demo.Hosting.Owin.csproj(165,3): error MSB4019: The impo
rted project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebAp
plications\Microsoft.WebApplication.targets" was not found. Confirm that the pa
th in the <Import> declaration is correct, and that the file exists on disk.
Oh joy. I've tried explicitly setting TargetFrameworkVersion to "v4.0" without any luck.
I thought .NET Framework 4.5 and VS2012 weren't supposed to screw things up?!
@asbjornu
Copy link

MSBuild + Visual Studio + .NET Framework SDK = Clusterfuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment