61

I'm trying to deploy a web application using MSDeploy, on Team Build in TFS. There are several questions that address the properties that have to be passed in MSBuild in order to call MSDeploy, but I haven't found sufficient documentation for what properties are available. Does someone have a list of available properties?

Here are some questions that I've found, but I haven't been able to find a definitive list of the properties:

Community
  • 1
  • 1
merthsoft
  • 878
  • 1
  • 7
  • 10

6 Answers6

118

Here's a list I've compiled for my own reference, along with some of the legal values that can be used. Note that these are passed into MSBuild using the /p:<PropertyName>=<Value> syntax.

  • DeployOnBuild
    • True
    • False
  • DeployTarget
    • MsDeployPublish
    • Package
  • Configuration
    • Name of a valid solution configuration
  • CreatePackageOnPublish
    • True
    • False
  • DeployIisAppPath
    • <Web Site Name>/<Folder>
  • MsDeployServiceUrl
    • Location of MSDeploy installation you want to use
  • MsDeployPublishMethod
    • WMSVC (Web Management Service)
    • RemoteAgent
  • AllowUntrustedCertificate (used with self-signed SSL certificates)
    • True
    • False
  • UserName
  • Password
  • SkipExtraFilesOnServer (leave existing non-conflicting files alone)
    • True
    • False
Philip Hanson
  • 1,847
  • 2
  • 15
  • 24
  • 2
    I also found this one today: `/p:SkipExtraFilesOnServer=True` This is the equivalent of the checkbox when doing a right-click publish with webdeploy: "Leave extra files on destination (do not delete)" – Ben Barreth Mar 26 '12 at 19:42
  • Thanks @BenBarreth - I added SkipExtraFilesOnServer to the list. – Philip Hanson Mar 28 '12 at 15:24
  • 21
    [Here](http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.build.workflow.activities.msbuild.aspx#Y0) is the class from MSDN that contains these properties. Still pretty crummy documentation, but it is at least a full list – JCisar Aug 17 '12 at 20:48
  • Best thing ever. Thank you for this question and the answers. – theo Dec 19 '12 at 06:56
  • I didn't find this in the list (nor MSDN's list?): `/p:ProjectParametersXMLFile=parameters_release.xml` which will point out another parameters-file for web deployment package and publishing. – cederlof Oct 09 '13 at 08:45
  • So if I want delete all of the files on the server except a certain directory (skip) would it just be as simple as creating the target in my web application project file? – The Muffin Man Apr 15 '14 at 18:12
8

Unfortunately documentation for this is almost non-existent at this point. If the various blog posts and forum posts aren't comprehensive enough, you can always look at the .target file that MSDeploy uses which shows how the various properties are used if you are willing to spend the time to wade through copious amounts of XML.

On my machine it's located here:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets
Undo
  • 25,519
  • 37
  • 106
  • 129
Dylan Smith
  • 22,069
  • 2
  • 47
  • 62
  • 1
    For those who need help understanding what they are looking at when they are viewing the xml that Dylan is talking about, the `PropertyGroup` tags contain the parameters that you can pass to MSBuild. – bowserm Nov 19 '15 at 18:45
4

I don't know if this is what you are looking for but you can invoke msdeploy with the /? argument and it will display a list of valid arguments

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
1

How about this one /p:IncrementalBuild=True

1

Some more here https://msdn.microsoft.com/en-us/ff622991.aspx (for sharepoint)

To create a package in build: /p:IsPackaging=true

To set the publish directory in the same drop output location: /p:PublishDir= When your solution contains multiple app projects, set the following parameter to produce app specific publish directories. /p:AppSpecificPublishOutputs=true

1

WebDeploy configuration of a SelfContained .NET Core2 application. Note 2 mandatory properties:

Missing RuntimeIdentifier throws:

error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false.

Missing DeployIisAppPath can throw:

error : Property 'DeployIisAppPath' must be non-empty.

In case you are passing the parameters to dotnet publish, avoid circular dependency with /p:DeployOnBuild=false

error MSB4006: There is a circular dependency in the target dependency graph involving target "Publish".

Complete WebDeploy configuration for command line:

/P:WebPublishMethod=MSDeploy
/P:DeployOnBuild=True 
/P:DeployTarget=MsDeployPublish 
/P:TargetFramework=netcoreapp2.0 
/P:SelfContained=true 
/P:MsDeployServiceUrl=https://my_subdomain.jobit.io:8172/MsDeploy.axd?site=subdomain_path
/P:AllowUntrustedCertificate=True 
/P:MSDeployPublishMethod=WMSvc 
/P:CreatePackageOnPublish=True 
/P:UserName=OTB
/P:Password=Expert 
/P:RuntimeIdentifier=win-x86
/P:DeployIisAppPath=subdomain_path
profimedica
  • 2,716
  • 31
  • 41
  • I like to use this config so I get the bare files to deploy copy-paste (I dont like any special packaging, just too opaque) -c $(buildConfiguration) -o $(build.artifactStagingDirectory) -p:DeployOnBuild=false -p:DeployDefaultTarget=WebPublish -p:WebPublishMethod=FileSystem -p:DeleteExistingFiles=True – Kat Lim Ruiz Jun 18 '19 at 14:28