32
votes

We are trying to configure continuous integration with TFS 2012. While queuing a new build, the publish fails with the error:

Build FAILED. "C:\src\ProjectName.sln" (default target) (1) -> "C:\src\Website\ProjectName.csproj" (default target) (2) -> (MSDeployPublish target) -> C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4377,5): msdeploy error ERROR_COULD_NOT_CONNECT_TO_REMOTESVC: Web deployment task failed. (Could not connect to the remote computer ("ServerName") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC)**

I checked all the points mentioned in the IIS.NET documentation for this error. Both services mentioned, Web Management Service and Web Deployment Agent Service, are running fine. A restart of those services has no change in behavior.

  • Windows Server 2008 R2 with IIS 7.
  • Web Deployment Agent Service is running on port 8172.
  • Web Deploy 3.0
  • Windows Firewall is not blocking any port on the server.

How can this be fixed?

8
Are you trying Continues Integration first time? if yes, try to create a publish profile on your web project and try to web deploy manually.suresh2
Thanks for replying. I tried publishing locally on the server by creating a publish profile and tried web deploying manually, but it is still giving the same error. Also while hitting the URL - ServerName:8172/msdeploy.axd, I am getting the HTTP 404 file not found error. Please Help..Alok Dhyani
I Have also Tried Re-installing the wmsvc serviceAlok Dhyani
Looks like, you didn't install web Deploy properly. did you follow all these steps in this link iis.net/learn/install/installing-publishing-technologies/… ? Try Reinstall that.suresh2
I just spent two days on exactly the same thing. My problem was a typo. The name of my site was SampleService and in my script that called msdeploy I typed server:8172/msdeploy.axd?site=SampleServer (the actual names are longer making it that much less obvious).biscuit314

8 Answers

81
votes

If you install Web Deploy 3.5 BEFORE Web Management Tools are installed, you'll have to re-install it. I beat my head against the wall for hours on this. Install the Web Management Services (Roles -> Web Server > Management Tools > Management Services). Then uninstall Web Deploy (repair didn't work), and then install it again. Fixed. /Sigh

38
votes

Double check in your Web Deploy settings that the name of the website is exactly that of what's in IIS.

enter image description here

enter image description here

Ben Day blogged more about it.

17
votes

Fix that i saw on another website:

Fix it by adding “http://” to server.

In other words, when server is www.xxxx.com would get the 403 error, but when server is http://www.xxxx.com, then it works.

4
votes

You need also to indicate the app name e.g 'Default Web Site/MyApp'

That was my error. Once I added /MyApp, it worked.

0
votes

I got this error when using msdeploy, not TFS. In my case I needed to make sure the user msdeploy is using had permission to deploy to the website.

Find the website in IIS manager, right click and go to Deploy, then Configure Web Deploy Publishing. Find the user used by Web Deploy and setup for this website.

0
votes

In my case the Internet proxy was enabled on source - which made msdeploy to reach out to internet instead of local ICN.

0
votes

You should check the logs on your IIS first - see that you actually get to the server, and then you can locate the exact error here - https://support.microsoft.com/en-us/help/943891/the-http-status-code-in-iis-7-0-iis-7-5-and-iis-8-0

Uninstalling and re-installing (not repairing!) after setting up IIS did most of the magic for me.

0
votes

There is another possible cause of the error. IIS Managemente Service have its own configuration for IP Address Restrictions, which default value is Deny Access for unspecified clients (Windows Server 2012 R2 with IIS 8.5).

You must set this value to Allow or add access to your specific IP address/IP address range using the Allow... button.

Remember, you must Stop the Management Service previously to change this configuration.

Allow access for unspecified clients in Management Service