I've got two web projects in one solution, and I'd like to deploy them both using msbuild and WebDeploy (this happens through a CI server).
Currently, I'm running a command line:
C:\ProjectFolder>msbuild <solution>.sln
/p:Configuration=<Release>
/p:OutputPath=bin
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=https://<ServerUrl:port>/msdeploy.axd
/p:username=<user>
/p:password=<password>
/p:AllowUntrustedCertificate=True
/p:DeployIisAppPath=<SiteName>
/p:MSDeployPublishMethod=WMSVC
This deploys one project, as expected. But how can I deploy the other as well? There's nowhere in this command line where I specified a project name - why did it choose one project to deploy over the other?
Ideally, I'd be able to deploy two project with the same command, something like
...
/p:Project=Project1
/p:DeployIisAppPath=<SiteName>/Project1
/p:Project=Project2
/p:DeployIisAppPath=<SiteName>/Project2
But I doubt that's possible. Alternatively, I just want to know how to specify a project name in the command line.
SetParameters. xml file. This provides a set of parameter values to the MSDeploy.exe command. You can update the values in this file and pass it to Web Deploy as a command-line parameter when you deploy your web package.
Deploy should mean take all of my artifacts and either copy them to a server, or execute them on a server. It should truly be a simple process. Build means, process all of my code/artifacts and prepare them for deployment. Meaning compile, generate code, package, etc.
Go to C:\Windows\System32 and right click on CMD. EXE. Choose “Run as Administrator”. Once the command prompt is up, you will navigate to the folder level where MSDeploy.exe exists.
I think it would be better to divide the single call to three:
- Build sln;
- Deploy site1;
- Deploy site2;
msbuild.exe <solution>.sln
/p:Configuration=<Release>
/p:OutputPath=bin
msbuild.exe project1dir\proj1.csproj
/p:Configuration=<Release>
/p:OutputPath=<Path to common bin>
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=https://<ServerUrl:port>/msdeploy.axd
/p:username=<user>
/p:password=<password>
/p:AllowUntrustedCertificate=True
/p:DeployIisAppPath=<SiteName>/Project1
/p:MSDeployPublishMethod=WMSVC
msbuild.exe project1dir\proj2.csproj
/p:Configuration=<Release>
/p:OutputPath=<Path to common bin>
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=https://<ServerUrl:port>/msdeploy.axd
/p:username=<user>
/p:password=<password>
/p:AllowUntrustedCertificate=True
/p:DeployIisAppPath=<SiteName>/Project2
/p:MSDeployPublishMethod=WMSVC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With