14

I have setup continuous integration for a WCF project and want to use the MSBuild Arguments to automatically deploy the application to a remote server but it is not deploying.

When running a new Build all the Tests pass and all the projects build but the website is not being deployed. Also, I am getting no errors back from the build to say anything has gone wrong.

I have opened up port 8172 on the remote server to ensure connections can be made to IIS and have even disabled the firewall.

In the Build Configuration I have specified the following arguments;

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:DeployIisAppPath="Default Web Site/MYSite" /p:MsDeployServiceUrl=http://mysite.com /p:username=MySite\Administrator /p:password=thePassword

I compiled this configuration from the following examples:

http://vishaljoshi.blogspot.co.uk/2010/11/team-build-web-deployment-web-deploy-vs.html

http://www.chrissurfleet.co.uk/post/2011/07/21/Setting-Up-Continuous-Deployment-In-TFS.aspx

I have configured the Server's IIS to enable remote connections and I can Remotely administer IIS from the build server. Also I have successfully deployed the Application using Visual Studio 2012 Publish option.

can anyone see a problem with my MS Build Arguments? Am I missing anything?

Any help would be very grateful

Update:

I have checked the build server to check MS deploy is installed and have installed Web Deploy 3.0 to ensure this is capabale, but has not solved my problem.

I have check the IIS connection logs to see if the remote connection to IIS is being made and there is no connection being made from my build server to the app server.

I have tried running MSBuild.exe for the solution and project on the build server manually with the following:

MSBuild.exe "Project Location" /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=WMSVC /p:DeployIisAppPath="Default Web Site/app" /p:MsDeployServiceUrl=http://appserver:8172/MSDeploy.axd /p:AllowUntrustedCertificate=True /p:CreatePackageOnPublish=False /p:Username=username /p:Password=password

The MSBuild is successfully building the project but is making no attemp to deploy it.

Any Ideas?

Andy Clark
  • 3,133
  • 7
  • 24
  • 41
  • 1
    I think that `/p:MsDeployServiceUrl` needs to either be a server name (the deployment URL will be constructed) or a URL to the deployment service endpoint (not the site.) Does http://stackoverflow.com/questions/7676840/vs2010-tfs-build-failure-could-not-complete-the-request-to-remote-agent/7677465#7677465 help? – Edward Thomson Sep 18 '12 at 16:47
  • 1
    Thanks, I will give this a try. Do I need to specify which project to deploy in the build arguments? When I am using continuous intergration I have specified the Solution to be built, not the WCF project. – Andy Clark Sep 19 '12 at 07:16
  • removing http:// from the server name also helped this to work – Andy Clark Sep 19 '12 at 16:53
  • The frustrating answer is that you can't deploy using TFS Build out of the box. I've seen other tutorials that publish using MSBuild parameters, but the problem is that even if it worked the deployment would occur halfway through the build and before the test cases execute! In effect, you'd be deploying your "failed" builds as well. On Team Foundation Service, Microsoft uses customized workflows that have an integration step - you could go the same route, but it would require custom development of the build process. Perhaps a Powershell script called by the workflow? – ShadowChaser Feb 11 '13 at 16:44

1 Answers1

7

Turns out the problem was files were missing on the Build Server as desibried in the Answer to this question:

Similiar problem

Also when installing Web Deploy 3.0 using Web Platform installer not all the features required are installed in order to connect remotely to IIS through MSBuild command line.

I copied the nessesery files from my dev machine to the build server and installed Web Deploy 3.0 manually with all features and this now works!

Maybe there is a bug with TFS 2012???

Community
  • 1
  • 1
Andy Clark
  • 3,133
  • 7
  • 24
  • 41