0

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?

undeniablyrob
  • 1,339
  • 2
  • 16
  • 16

1 Answers1

1

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

Isantipov
  • 19,491
  • 2
  • 26
  • 41
  • Ah, I failed to mention in the OP post that I am using this command; however, the package is not getting published to the destination server specified in the publish profile. Is it correct that it WILL publish to the server, or does it just create the package zip file locally? – undeniablyrob Jul 21 '14 at 04:06
  • @coderob depends on the `WebPublishMethod` in your profile, `FileSystem` or `Package` will create locally, `MSDeploy` will deploy to server. – Ilya Kozhevnikov Jul 21 '14 at 08:53
  • @coderob , you have to share the command, publish profile and build log/output in order to get some help. At this point it's impossible to figure out what your trouble is. – Isantipov Jul 22 '14 at 13:56