Getting a 404 from WMSvc via MSDeploy.exe

IisMsdeployIis 8

Iis Problem Overview


From Windows 8 to Windows Server 2012 (IIS 8) with Web Management Services installed and working, I can use IIS Manager on W8 box to manage the remote server but I get a 404.7 from WMSvc when I execute the following command:

msdeploy.exe" -verb:dump -source:contentPath=c:\InetPub\wwwroot,computerName=https://uktnws01:8172/MsDeploy.axd,userName=corp\administrator,password=WMSvcIsCrap,authType=Basic -allowUntrusted

I've tried all sorts of combinations and parameters. I can telnet to that port, I know its open.

I'm just removing the Management Service feature from Windows and restarting. I will pour myself a scotch and make some snacks. In the meantime, if you have any ideas, please share.

Join my live blog below and follow the action.

Update 1

With Management Service removed, I now get

> Error: Unable to connect to the remote server Error: No connection > could be made because the target machine actively refused it > 192.168.2.22:8172 Error count: 1.

Where the 2nd line is a new message! Woohoo.

Update 2

Okay, so things are going from bad to worse now. Since reinstalling, the remote IIS console will alert on the certificate and then say,

> The server is not accepting remote connections.

But I think this is because I probably didn't re-enable Remote Management, on top of installing the damned thing.

Update 3

With Remote Management enabled, the remote IIS works again but the 404 has returned. Just in the interests of SEO, here's the full error:

Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to the remote computer ("uktnws01"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.

Update 4

Tried the same command against another web server over a VPN to a client and that works a charm! Looks like IIS is fubar'ed on my absolutely spanking new 2012 build.

Update 5

I enabled failed request tracing for WMSvc and have seen that the 404.7 comes from the RequestFilteringModule module. 404.7 is 'File Extension Denied' according to the documentation.

http://www.iis.net/configreference/system.webserver/security/requestfiltering

Adding an explicit server rule for .axd files does not help though. Interesting to see this module though since it imposes restrictions on URL length and content sizes. Can you imagine troubleshooting this in an IIS hosted WCF app! Haha. I'm crying really.

Update 6

I'm removing Request Filtering which means removing ASP.NET and various other things also. They need a Reinstall Windows Features & Dependencies All In One Hit Because We Write Unreliable Software option.

Update 7

I reinstall everything and then some Aussie named Richard appears out of nowhere and totally explains that Web Deploy isn't actually a part of WMSvc as standard, even on IIS 8, and that I need to install Web Deploy.

So I do. Then I disable MsDepSvc which is the other part it installs (which I thought was the entirety of Web Deploy) because it sucks on port 80 and stops load balancers from seeing a downed IIS service.

And it works. I can go to bed.

Iis Solutions


Solution 1 - Iis

In case someone else is having the same issues than what I am having, I also got the same 404 error. The quickest way I found to check was to go on the server itself, and open up "https://<servername>:8172/MsDeploy.axd". Chrome & Firefox just showed a blank page, so I had to use the Network tab of the developer tools (F12) to see the actual 404 error message.

Somehow, while installing Web Deploy 3.0 from the Web Platform Installer, the IIS 7 Deployment Handler didn't get installed, even though the IIS Manager UI Module did. In my case, I downloaded the Web Deployment Tool Installation .msi from the following link: Web Deployment Tool Installation. Then I had to go back to IIS Admin Tool (Start -> Run -> inetmgr.exe) > {server name} > click on Management Service icon, and restart the management service before the MsDeploy.axd handler started working.

Enabling IIS Deployment Handler + Remote Agent Service

enter image description here

Solution 2 - Iis

Have you installed Web Deploy on the server? Web Deploy registers a handler (/msdeploy.axd) with WMSVC, so a 404 would be the expected status code if it weren't installed.

Solution 3 - Iis

On Windows 2012 R2 Server I followed mga911's advice.

I was stuck getting deploys working. Had installed Web Deploy 3.5 -> Enabled Management Service Delegation -> Ensured Services were started. The problem was the IIS Deployment handler had not been installed. Going through Web PI 4.6 I was not given the opportunity to install the IIS deployment handler. You need to go into the control panel -> Programs and Features Change Web Deploy 3.5's installation. Please note my instructions. In the change process it indicates all the sub packages will be installed but the text message says 0 of 3 sub components will be installed. One of those components is the IIS handler. Read carefully because I didn't and was frustrated :)

  • Control Panel > Programs and Features

  • Right Click on Microsoft Web Deploy 3.5 * Select Change > click next > click change * You'll notice when Web Deployment Framework is selected you'll see in the message "It has 0 of 3 subfeatures selected" * Click on drop down select "Entire feature will be installed on local hard drive" * Next > Change >Finish

Solution 4 - Iis

One important point I think is that you have to turn on the Management service first and then install Web Deploy.

I did it the other way around and it didn't work.

Only by reinstalling Web deploy did it start working.

Solution 5 - Iis

When I installed Web Deploy via the web platform installer the Handler was not selected. I had to manually install Web Deploy 3.0, click"change" and then select the Handler to be installed.

Solution 6 - Iis

After hours of searching, doing your solution below worked for me !!

Control Panel > Programs and Features

Right Click on Microsoft Web Deploy 3.5

Select Change > click next > click change

You'll notice when Web Deployment Framework is selected you'll see in the message

 "It has 0 of 3 subfeatures selected"

Click on drop down select "Entire feature will be installed on local hard drive"

Next > Change >Finish

Solution 7 - Iis

In my case, when installing the web deploy 3.0 package through the web pi i never got the Management Service Delegation option in IIS /home .. reinstalling it rectified the issue however, thus resolving Resolved my 404.7 error.

This was under Microsoft Server 2012 and IIS8

Edit: I just recently tried the very same thing on Windows 8 and would like to point out that the microsoft website states:

> You cannot set up remote publishing using Web Deploy for a site that is hosted in IIS on Windows 8.0 or 8.1. The reason is that the client SKUs for Windows do not come with the Web Management Service that is required for remote connections. As a result, on Windows 8.0 or 8.1, the IIS Manager Permissions icon and the Configure Web Deploy Publishing deployment option that are required to configure remote publishing are not available in the IIS Manager. http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy-on-iis-80-or-later#00 > >(Yes i realize the target is Server 2012 in the question but this could save a lot of people from having the same headache as me, since this worked just fine on my old dev machine i wanted to let people know.)

Solution 8 - Iis

Rather than using Web Platform Installer. Download the WebDeploy.exe from the website and install it on server with Complete package option.

It will fix the issue.

Solution 9 - Iis

Additionally you might need to grant access for the Web Management Service

I also had the problem of Visual Studio (2013) couldn't update the app on my server (Windows 2012 R2 IIS 8.5). I added the components manually as described above, but that didn't solve the problem. Then I found [this article][1].

It basically says that the Web Management Service is logged on as Local Service which doesn't have access rights to the Inetpub directory. Granting permissions for Local Service solved the problem for me.

[1]: http://blogs.iis.net/krolson/using-iis-manager-accounts-for-web-deployment-tool-msdeploy-delegation "this article"

Solution 10 - Iis

I have got the same issue. I resolved this by "Restart-Service wmsvc".

Solution 11 - Iis

This issue still exists in server 2019 as well. Need to install web deployed in the correct sequence

  • first, start the service - web management service
  • then install the web deploy (download from Microsoft web site)

Solution 12 - Iis

Used only windows auth. Web deploy 3.5. And only the WMSVC certificate which is set in the Management Service icon of the top level server icon.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLuke PuplettView Question on Stackoverflow
Solution 1 - IisVeeTheSecondView Answer on Stackoverflow
Solution 2 - IisRichard SzalayView Answer on Stackoverflow
Solution 3 - IismuglioView Answer on Stackoverflow
Solution 4 - IishaymansfieldView Answer on Stackoverflow
Solution 5 - Iismga911View Answer on Stackoverflow
Solution 6 - IisLaurentView Answer on Stackoverflow
Solution 7 - IisCrypthView Answer on Stackoverflow
Solution 8 - IisFAHIDView Answer on Stackoverflow
Solution 9 - IisCaptain DashenkaView Answer on Stackoverflow
Solution 10 - IisEvgeny PonamarevView Answer on Stackoverflow
Solution 11 - IisHiranView Answer on Stackoverflow
Solution 12 - Iispat capozziView Answer on Stackoverflow