16

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.

2 Answers 2

19
  1. First you need to set up your deployment package settings (if you already have run "Build Deployment Package" go to Step 2):

    go in Project's Properties -> Package/Publish Web and specify the package location.

  2. 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 <C:\yourLocation\YourProjectName.csproj> /T:Package

Enjoy.

Sign up to request clarification or add additional context in comments.

1 Comment

By adding /p:Configuration=Release (Debug or whatever) you could also choose the build configuration you prefer.
0

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

/target: publish

4 Comments

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.
I think it's a new feature in VS2010 and it's detailed in here: msdn.microsoft.com/en-us/library/dd483479.aspx The 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.