2

I have a Visual Studio 2013 project. I need to deploy it to remote Windows Server via command line, is this possible?

I tried the following command:

MSBuild.exe C:\BuildAgent\work\e1434fd989e26b76\WebService.csproj /T:Package /P:Configuration=Release

This packages the project for me. Now what should I do to deploy it to the server via command line?

2 Answers 2

1

Create a new custom publish profile from visual studio. After creating it validate the connection from visual studio.Save this profile.Now in Properties/PublishProfiles there will be the new publish profile.pubxml.

After that try this.

msbuild "PATH_TO_SOLUTION_FILE" /p:DeployOnBuild=true /p:PublishProfile="PATH_TO_PUBLISH_PROFILE" /p:AllowUntrustedCertificate=true /p:UserName=USER_NAME /p:Password=PASSWORD

If you are executing the above from solution file path then just mention the solution name and publishing profile name. There is no need to give the entire path.

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

Comments

0

You can define a publishing profile and deploy by calling an msbuild.exe with:

/p:DeployOnBuild=true /p:PublishProfile=Foo

This is described here:

http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/command-line-deployment

Comments

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.