Search code examples
iisdeploymentmsbuildmsdeploypublish-profiles

Possible to have MSBUILD or MSDEPLOY deploy to server with publish profile?


We've used msdeploy to deploy to a server, but we have explicitly passed the server name, site name, username, and password in as parameters. It seems that, since all of this is contained in a publish profile, that we could just pass in the publish profile name and msdeploy/msbuild would pull the server name, etc. from there and do the rest.

Is this possible?


Solution

  • yes it is possible. Just run msbuild with appropriate properties applied, e.g. :

    msbuild YourProject.csproj /p:DeployOnBuild=true /p:PublishProfile=YourPublishProfileName
    

    Here is a good starter tutorial