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\to\WebApp.csproj" /target:package
But on my build server I get this error:
error MSB4057: The target "package" does not exist in the project.
What am I missing on the build server?
I just got this working without installing VS2010 by following these steps on the build server:
This seems to work for me
You need to have .Net 4.0 installed on the build server. The .Net 4.0 install will put the new MSBuild 4.0 which supports packaging web application projects.
Also, when you are running msbuild.exe make sure you are running the one that sits in the .Net 4.0 framework folder.
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.
To solve this problem install Visual Studio 2010 on the build server and make sure you installed
Visual Web Developer
feature.I experienced the same issue. Ended up resolving by adding this:
to my .csproj fiie.
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:
It is imported by:
Hope this helps someone like me :)