views:

927

answers:

2

How is it possible to build a web service deployment package from script.

I can msbuild /target:rebuild /p:Configuration=Debug ".\MyProject.sln" but it does not build the deployment package.

A: 

What type of project are you deploying? For most, it's a matter of using a different Target:-

/target: publish
Ruben Bartelink
It's a web project (not a setup project) and "publish" is also an option under the menu besides "Build deployment Package"
Also, that results in "skipping unpublishable project"
Might be useful if you could provide a link to a brief MSDN page or other article that describes what you're normally doing interactively. Do you have one project? Are you using Web Deployment projects? Are you using MSDeploy packages? You really havent given people a lot to go on, hence you got 2 quick guesses.
Ruben Bartelink
I think it's a new feature in VS2010 and it's detailed in here: http://msdn.microsoft.com/en-us/library/dd483479.aspxThe bit I would like to script up starts: "In the Project menu, click Build Deployment Package."I do have only one web project and if I can script it into a build process then I can deploy it automatically to a server.Hope that helps.
+6  A: 
  1. First you need to set up your deployment package settings:

Go in Project's Properties -> Package Publish Web and specify the package location. If you already has run "Build Deployment Package" go to Step 2.

  1. If you run this command:

msbuild /T:Package

it will build the deployment package for you using the .csproj in the directory where you run it and putting the package in the location specified in the project's properties in step 1. Better run it from the location where your .csproj file is.

If the location is different you need to supply the project name:

msbuild /T:Package

Enjoy.

Valko
"/t:package" that's the trick.