36

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?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Alok Dhyani
  • 363
  • 1
  • 3
  • 7
  • 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 Sep 11 '13 at 12:52
  • 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 - https://ServerName:8172/msdeploy.axd, I am getting the HTTP 404 file not found error. Please Help.. – Alok Dhyani Sep 12 '13 at 10:17
  • I Have also Tried Re-installing the wmsvc service – Alok Dhyani Sep 12 '13 at 10:23
  • Looks like, you didn't install web Deploy properly. did you follow all these steps in this link http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy ? Try Reinstall that. – suresh2 Sep 12 '13 at 12:37
  • No It didnt worked after following those steps mentioned in the link too. I am afraid what could be the problem. – Alok Dhyani Sep 13 '13 at 12:01
  • Try https://localhost:8172/msdeploy.axd in your Webserver. Make sure its working. if it is working, check firewall port is open for 8172 in firewall settings (Web Management Service (HTTP Traffic-In)). – suresh2 Sep 13 '13 at 13:34
  • On Hitting https://localhost:8172/msdeploy.axd it asks to proceed for untrusted connection, and on clicking it, it gives pop up for user name/pwd to connect to Web Management Service. I gave the credentials which has administrator rights, but on proceeding it shows 404 page. – Alok Dhyani Sep 16 '13 at 10:15
  • The user no need to be an administrator. The user can be a normal windows user and must be configured in the configure web deploy publishing screen in the IIS. Sorry, I am not sure what else to advise to solve this issue. uninstall everything and Try the steps again from the beginning. Try this link as well. http://forums.iis.net/p/1176267/1974277.aspx – suresh2 Sep 18 '13 at 08:40
  • 1
    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 http://server:8172/msdeploy.axd?site=SampleServer (the actual names are longer making it that much less obvious). – biscuit314 Oct 12 '13 at 14:47

8 Answers8

95

If you install Web Deploy 3.x BEFORE Web Management Tools are installed, you'll have to re-install Web Deploy. I beat my head against the wall for hours on this.

  1. Install the Web Management Services ("Turn Windows Features On/Off"/Roles -> Web Server -> Management Tools -> Management Service) enter image description here
  2. Then uninstall Web Deploy (repair didn't work) via the usual Add/Remove Programs control panel enter image description here
  3. Install Web Deploy 3.x again using Web Platform Installer.

Fixed. /Sigh

Caius Jard
  • 72,509
  • 5
  • 49
  • 80
Tom Hundley
  • 1,325
  • 9
  • 14
45

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.

p.campbell
  • 98,673
  • 67
  • 256
  • 322
17

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.

CRABOLO
  • 8,605
  • 39
  • 41
  • 68
Ella Moshe
  • 171
  • 1
  • 2
4

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

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

user3085805
  • 581
  • 5
  • 3
0

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.

zola25
  • 1,774
  • 6
  • 24
  • 44
0

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

Fairoz
  • 828
  • 2
  • 8
  • 21
0

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.

Gabi Lee
  • 1,193
  • 8
  • 13
0

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

Rafael Neto
  • 1,036
  • 10
  • 16