I have this error when configuring continuous integration in TFS server, but found the answer already. Maybe this will help others:
The imported project \"C:
And if you already have Visual Studio installed? Perhaps you have Visual Studio 2012 installed (and 10.0 indicates VS 2010)? If that's the case, you can just search your .csproj file for "10.0" and replace that with "11.0" and you'll then be able to open the project just fine.
If you don't deploy from the build server, then just turn off the Microsoft.WebApplication.targets
on the build server. See my answer here: https://stackoverflow.com/a/35781566/4955344
I had this problem as well except that this files were already there. After a lot of troubleshooting the answer turned out to be frustratingly simple: restart the build agent service. In my case it was: "Visual Studio Team Foundation Build Service Host 2013"
I experienced something similar.
I had written this in our Autobuild.targets
file run as part of a build. It defines MSWebApplicationTargets
:
<MSWebApplicationTargets>$(SolutionDirectory)\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3</MSWebApplicationTargets>
Then in a .csproj
file that is part of the project and used in the build it had:
<Import
Project="$(MSWebApplicationTargets)/tools/VSToolsPath/WebApplications/Microsoft.WebApplication.targets" />
Now our problem was that when we opened the project in Visual Studio it said that c:/tools/VSToolsPath/WebApplications/Microsoft.WebApplication.targets
doesn't exist (because VS considered MSWebApplicationTargets
to be undefined and so seemed to default it to c:\
). You don't provide enough information though perhaps that is what caused your problem also.
All I had to do to solve this was add a condition:
<Import
Project="$(MSWebApplicationTargets)/tools/VSToolsPath/WebApplications/Microsoft.WebApplication.targets"
Condition="'$(MSWebApplicationTargets)' != ''" />
Microsoft.WebApplication.targets
As part of some futher discussion, I did this with Microsoft.WebApplication.targets
so we didn't have to rely on Visual Studio being installed on the build servers. I added it as a dependency:
manage nuget packages
. This created a packages.config
file that listed MSBuild.Microsoft.VisualStudio.Web.targets
as a dependency. nuget.exe restore
to the start of the build script so that the dependencies are downloaded.