Search code examples
tfstfsbuildvisual-studio-2012webdeploybuild-definition

TFS build definition does not deploy web application to IIS


I am currently trying to get a TFS Build Definition to automatically deploy my web application to the server. The build definition is just a standard manual build definition.

I have create the build definition correctly within the team explorer for my project, and when I queue a build, it completes successfully.

I have set the MSBuild Arguments property in the Build process parameters section to be:

/p:DeployOnBuild=True 
/p:Configuration="Release" 
/p:DeployTarget=MSDeployPublish 
/p:MSDeployPublishMethod=WMSVC 
/p:MsDeployServiceUrl=myserver.com 
/p:DeployIISAppPath="Default Web Site" 
/p:username=username 
/p:password=password 
/p:AllowUntrustedCertificate=True 
/p:SkipExtraFilesOnServer=True

However, when I view my web application in IIS, files that should be there are missing, such as the web.config file.

Right clicking my web application within Visual Studio and publishing via Web Deploy, using the above settings works correctly, and the web.config and other files that were published are shown in the web root.

This is just a development server, so the TFS and IIS are installed on the same machine, and changing the /p:MsDeployServiceUrl to be localhost instead also has no effect.

Is there something I am missing from the Build Definition, or a required parameter to get the TFS build to deploy my web application?


Solution

  • All of the properties you've declared look good, with the exception of the service URL. It needs to point to the full path of the Management Service on your target server.

    /p:MsDeployServiceUrl=https://yourserver:8172/msdeploy.axd
    

    The default port for the Management Service is 8172, but if your target has been set up differently, you'll need to adjust.