Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild target package not found

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?

like image 446
Andrew Davey Avatar asked Apr 09 '10 12:04

Andrew Davey


People also ask

Will MSBuild compile without any target?

If there are no initial targets, default targets, or command-line targets, then MSBuild runs the first target it encounters in the project file or any imported project files.

What is PackagePath?

PackagePath : Path where the file should be output in the package.

What is MSBuild target?

A target element can have both Inputs and Outputs attributes, indicating what items the target expects as input, and what items it produces as output. If all output items are up-to-date, MSBuild skips the target, which significantly improves the build speed. This is called an incremental build of the target.

How do I run a target in MSBuild?

At the command line, type MSBuild.exe <SolutionName>. sln , where <SolutionName> corresponds to the file name of the solution that contains the target that you want to execute. Specify the target after the -target: switch in the format <ProjectName>:<TargetName>.


1 Answers

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

like image 50
spmason Avatar answered Oct 05 '22 03:10

spmason