I want to package my VS2010 web application project ready for deployment with msdeploy. On development machine I can do this using:
MSBuild.exe \"C:\\path\\t
I experienced the same issue. Ended up resolving by adding this:
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
to my .csproj fiie.
I just got this working without installing VS2010 by following these steps on the build server:
This seems to work for me
To solve this problem install Visual Studio 2010 on the build server and make sure you installed Visual Web Developer
feature.
Also consider using msbuild with version, corresponding to Web Deployment tool version. I have faced same problem as the OP. The solution was to change msbuild from 4.5 to 4.0 on buildServer.
I know it's an old question, but I recently ran into the same issue and none of the answers helped. I was missing following file on my build server:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio
\v11.0\Web\Microsoft.Web.Publishing.targets
It is imported by:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio
\v11.0\WebApplications\Microsoft.WebApplication.targets
Hope this helps someone like me :)
You may install MSBuild.Microsoft.VisualStudio.Web.targets package. No need to manually copy targets to build server.