0

In Visual Studio 2010 we can right click a Web application and select Publish from the Menu. Using this we can publish a web application to a File System.

How can we achieve the same using Command line?

EDIT: Although we can use xcopy as suggested it is not same as Publish command as we have to manually exclude unnecessary files.

3 Answers 3

2

You're looking for Aspnet_compiler.exe to publish using the command line.

If using MSBuild then you need the AspNetCompiler Task.

The options the Aspnet_compiler provides are the same as those provided by Visual Studio's Publish option.

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

Comments

2

You can pass optional properties to the MSBuild script to call MSDeploy (Assuming you have it setup on both the client/server).

/p:DeployOnBuild=True – This will let us deploy after build

/p:DeployTarget=MsDeployPublish – This set how we will deploy, using MSDeploy

/p:MSDeployServiceURL=http:///MsDeployAgentService

/p:DeployIISAppPath="Default Web Site" – The path where the app will be deployed

/p:CreatePackageOnPublish=True – Create a package to deploy the App

/p:MsDeployPublishMethod=RemoteAgent – Server where the MSDeploy is installed. The possible values for this are:

RemoteAgent – When the MSDeploy is deployed at another machine

InProc – Deploy to the Local IIS

/p:AllowUntrustedCertificated=True – Connect to the MSDeployServiceURL without trying to use certificate.

To use a certificate you should use another URL on the MSDeployServiceURL.

/p:UserName=username – The username of a user with permission to Deploy the application

/p:Password=password – a VALID password for that user :)

Taken from Allmatech ALM Team

Comments

0

Have you tried something like this

xcopy *.* \\server\folder

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.