views:

509

answers:

3

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?

A: 

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.

Paul Lemke
+1  A: 

To solve this problem install Visual Studio 2010 on the build server and make sure you installed Visual Web Developer feature.

Mendy
+5  A: 

I just got this working without installing VS2010 by following these steps on the build server:

  1. If .NET Framework 4 isn't installed, install it
  2. Install the Web Deployment tool from http://www.iis.net/download/webdeploy
  3. From the C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0 folder on your dev machine copy the "Web" and "Web Applications" folders to the equivalent directory on your build server.

This seems to work for me

spmason
Also make sure that you use the .net 4 version of MSBuild.exe!(in %windows%\Microsoft.net\Framework\v4.0.30319)
AndyM