37

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?

9
  • 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. Commented Sep 11, 2013 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 - ServerName:8172/msdeploy.axd, I am getting the HTTP 404 file not found error. Please Help.. Commented Sep 12, 2013 at 10:17
  • I Have also Tried Re-installing the wmsvc service Commented Sep 12, 2013 at 10:23
  • 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. Commented Sep 12, 2013 at 12:37
  • 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 server:8172/msdeploy.axd?site=SampleServer (the actual names are longer making it that much less obvious). Commented Oct 12, 2013 at 14:47

9 Answers 9

99

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

Sign up to request clarification or add additional context in comments.

3 Comments

another nonsense/illogical bug from MS, made me wanna kill myself
This saved an hour at my work today. Thanks a lot. You deserve many upvotes.
This is the correct answer. However, I want to add that one should choose a "complete" installation when installing Web Deploy. The "recommended" install does not include the essential features.
50

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.

3 Comments

I would like to add that for an application under a website, the site name becomes "Default Web Site/myapp". Took me a while to figure out.
Example of an MSDeploy Url: https://{ServerName}:8172/MsDeploy.axd?site={siteName} You get this error when the site name is incorrect.
I had http:// in <DeployIisAppPath>xxx</DeployIisAppPath>After removing http:// published worked.
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.

2 Comments

Thank you! almost cant believe I fell over that error.
This fixed it for me... all the other solutions were not it. Thank you!
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.

2 Comments

Thanks, often it's not the computer it's your own silly self!
and - it hurts even more when you fall for it again!
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.

Comments

0

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

Comments

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.

Comments

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

Comments

0

The resolution for my me was setting IIS Management Service to a new SSL certificate as explained in https://stackoverflow.com/a/64706624/130614.

IIS Manager

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.