135

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.

Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
  • 26
    +1 for the hilarious password – Michael12345 Jun 19 '13 at 05:34
  • 5
    How much productivity are we all losing to this mess? I am running into a similar issue but I'm running into a case where IIS crashes when looking up usernames. – ATL_DEV Dec 18 '13 at 23:34
  • 6
    On Windows 2012, it was install order for me, I had to first install the Web Management Service feature, then install web deploy 3.5. – JustEngland Nov 17 '15 at 16:24
  • 1
    Installing web deploy is not enough!. I had web deploy installed, it was the first thing I did. I had to go to add/remove programs and change installation settings to include the handler. I wish love, happiness and prosperity to the MS dev who thought it was a sensible default to not include the handler which lets the service do it's job. – nurettin Nov 09 '17 at 06:29
  • I had all sorts of problems trying the to get Web Deploy 3.6 working, so followed Sinned Lolwut's comment and uninstalled 3.6, and installed 3.5 instead - worked first pop. I used Web Platform Installer (https://www.microsoft.com/web/downloads/platform.aspx) to install Web Deploy 3.5. Restarted Web Management Service afterwards, and was able to validate the connection in the Visual Studio Web Deploy profile. (I would have replied in a comment above but don't have enough reputation yet). – bob number 2 Jan 25 '20 at 02:51
  • I can confirm what worked for me: - Web Management Service must be installed & set up before Web Deploy -Make sure Web Management Service allows Remote Connections & valid certificate bound -Then install/reinstall web deploy. I used the latest Web Deploy 3.6 (x64) – timk Mar 31 '23 at 03:41

13 Answers13

199

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

Community
  • 1
  • 1
VeeTheSecond
  • 3,086
  • 3
  • 20
  • 16
  • 106
    I was able to go to Control Panel > Programs and Features. Right-click "Microsoft Web Deploy 3.5" and select "Change". From the installer select "Change" and "IIS Deployment Handler" was available as an option (was disabled at first. Also "Configure for Non-Administrator Deployments" and "Management Service Delegation UI" were additional options.) My very first request to `MSDeploy.axd` still had the 404 but the next request received a login prompt. – Carl G Aug 12 '13 at 21:31
  • 3
    And if you're forgetful like me, remember that you must have already installed the Management Service (Add/Remove Windows Features > Web Server (IIS) > Management Tools > Management Service) before the "IIS Deployment Handler" is visible while changing the Web Deploy 3.5 install. – Carl G Aug 22 '13 at 20:00
  • @DGDev Web Deployment Tool 2.1 is the precedecessor of Web Deploy 3.0 – Kuepper Mar 06 '14 at 13:26
  • 1
    Hey Carl G, your comment was the only useful thing I found for this problem. I wish it could be a part of answer instead of a simple comment here. (Admin please put it as a right answer if possible) – mohghaderi Dec 11 '14 at 07:27
  • @CarlG - great catch! I added a screen capture for reference. – SliverNinja - MSFT Jan 16 '15 at 22:07
  • Thank you, thats exactly what I was missing. I was visiting the URL and it spend minutes loading the page to say no data received. – Tod Mar 05 '15 at 14:00
  • been struggling about this since I believed I had done everything right. Thanks so much. – Ege Aydın Dec 19 '16 at 13:09
  • I had to install from the website to see these options for my Windows Server 2012 box : The URL is here https://www.iis.net/downloads/microsoft/web-deploy Just choose change and you can then follow the instructions in this answer. ( I could not see it from Control Panel on Server 2012) – Anthony De Souza Mar 24 '17 at 16:48
  • For the love of god . . . Microsoft, stop doing stuff like this! – Ross Brasseaux Jun 19 '17 at 17:06
93

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.

Richard Szalay
  • 83,269
  • 19
  • 178
  • 237
  • 2
    No I haven't. I didn't know I needed to! I thought that the whole deployment thing was part of WMSvc? OMG, I reckon you're right, they are that stupid. I have recently been so confused with all this and thought Web Deploy the thing you install was just the agent, for hosting companies and the like. Check out my other question http://stackoverflow.com/questions/13602502/why-does-the-web-deploy-agent-service-listen-on-port-80-and-8172 – Luke Puplett Dec 14 '12 at 00:50
  • 2
    WMSVC is for remotely configuring IIS. MSDeploy was created long afterwards so can't be integrated into the core. If installing MSDeploy is not a possibility, you can use a [temp agent](http://technet.microsoft.com/en-us/library/dd569001%28v=ws.10%29.aspx) which will install a handler for the duration of the deploy (you'll need admin access, obviously). – Richard Szalay Dec 14 '12 at 00:59
  • More on temp agents here: http://technet.microsoft.com/en-us/library/ee517345(v=ws.10).aspx - But I assume Web Deploy must installed on the 'master' server in a synch operation for it to get the binaries from. They could just have all this already registered in WMSvc out the box. Thanks Richard, awesome. – Luke Puplett Dec 14 '12 at 01:19
  • 18
    I had to uninstall Web Deploy 3 and then reinstall it again to get it working. Somehow my IIS8 was messed up. – Rosdi Kasim May 31 '13 at 17:23
  • 31
    Same issue, just went into Control Panel and changed the "Web Deploy" install to include the Handler. Restarted The WMSVC Service and all was good! – Matt Woodward Feb 23 '14 at 02:27
  • 13
    If you installed Web Deploy before you installed the Web Management Service you will need to follow the procedures described above – Matt Baker Dec 13 '14 at 01:18
  • Yes, apparently the "Typical" install recommended by the msi does not have this - another facepalm moment brought to you by microsoft – jenson-button-event Mar 06 '17 at 16:17
  • When I installed web deploy, I forgot to install Management Service along with it. I installed it later and set it to start automatically, but still was getting the 404 error. I uninstalled web deploy and reinstalled and it started working. I guess management service needs to be installed before web deploy. Also make sure that your installed ASP.Net version on IIS is same as that of your application before installing web deploy. – Rohit Jain Sep 25 '17 at 07:12
  • 2
    @RohitJain That's correct, the `/msdeploy.axd` handler won't install if Management Service isn't already installed. You did the right thing by uninstall/reinstalling (though you might also have been able to do a repair) – Richard Szalay Sep 25 '17 at 09:14
69

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
muglio
  • 2,048
  • 17
  • 18
  • 2
    Tried this trick with Web Deploy 3.6 on Win 2012 R2. Didn't work with the following error "Error: "The configuration section 'system.webServer/management/delegation' cannot be read because it is missing schema"... Uninstalled Web Deploy 3.6 and got Web Deploy 3.5 off of http://www.iis.net/downloads/microsoft/web-deploy Worked. – Sinned Lolwut Aug 27 '16 at 12:37
  • This very help me! Thank's. Win2012 r iis 8 – Roberto Gata Jul 06 '18 at 16:21
19

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.

haymansfield
  • 5,419
  • 4
  • 34
  • 51
  • Same thing happened to me. What a nightmare! – Christopher Townsend Jun 20 '14 at 12:31
  • 1
    I guess most of the people here (including myself) had the same issue but they didn't realize it because uninstalling web deploy, reinstalling it again and then restarting the Management Service is pretty much the same thing :) – ilter Dec 13 '14 at 21:20
14

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

Sulthan Allaudeen
  • 11,330
  • 12
  • 48
  • 63
Laurent
  • 141
  • 1
  • 2
13

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.

mga911
  • 1,536
  • 1
  • 16
  • 33
8

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.)

Community
  • 1
  • 1
Crypth
  • 1,576
  • 18
  • 32
4

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.

FAHID
  • 3,245
  • 3
  • 18
  • 15
1

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.

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

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

B.shruti
  • 1,589
  • 1
  • 21
  • 41
  • 1
    Hey, upvoted your question as it seems to help, as this is your first answer here, would be great if you could write a tiny litle bit more next time. Just a few more words, full sentences are really appreciated :) – Tim Cadenbach Mar 11 '20 at 12:53
0

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)
Hiran
  • 1,102
  • 11
  • 18
0

In my case, using http://<server_address> instead of https://<server_address> in Server field (1st item in publish settings dialog) worked.

Prashant Agarwal
  • 729
  • 7
  • 23
-1

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.

pat capozzi
  • 1,412
  • 1
  • 20
  • 16