103

We had a Web Application working on an intranet and I'm trying to publish it to the internet using Visual Studio 2010. The destination server is running iis7 and the Web Management Service is running.

On Visual Studio 2010 my service URL is:

https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd

And site/application is:

Default Web Site/WebApp

Marking as IIS App on destination and Allow untrusted certificate is checked and i'm using an administration account.

Visual Studio return the following error:

Start Web Deploy Publish the Application/package to https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default%20Web%20Site ... C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3588,5): Error : Web deployment task failed.(Remote agent (URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default Web Site) could not be contacted. Make sure the remote agent service is installed and started on the target computer.)

Remote agent (URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default Web Site) could not be contacted. Make sure the remote agent service is installed and started on the target computer. An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected. The remote server returned an error: (403) Forbidden.

Any ideas how to publish it without a valid SSL certificate?

dcarneiro
  • 6,720
  • 10
  • 46
  • 73

4 Answers4

249

If you go into IIS,
Click on the server node in the "Connections" list,
Double click "Management Service" then you are taken to a screen which has an "Enable remote connections" check box.
This checkbox (and the rest of the sreen) maybe greyed out because the service is running. Just click the "Stop" link in the Actions pane, then check the "Enable remote connections" box and any other settings you want to change here, then click 'Apply' and 'Start' on the Actions pane again.

That should hopefully let you connect, with proper credentials, to the service from a remote machine. (If the correct ports and stuff are opened and all that jazz.)

I think this helps your situation. At least you won't get 403's but you may have some other MsDeploy error.

icepicker
  • 2,991
  • 1
  • 20
  • 16
  • 4
    I had the same problem. I believe my config was corrupt due to a hard reboot during a config change. I took these steps, but didn't change anything. (Changed auth to Windows only, Apply, and then back to Windows + ISS Mgr). That fixed it for me. – Kasey Speakman Feb 10 '12 at 16:52
  • @KaseySpeakman Thanks. Something about the way the service is installed and/or IIS manager for some reason requires this. Maybe the configuration doesn't get reset unless changes are detected. Finally got this working after flipping auth back and forth and restarting the service like you suggested. (Just restarting the service alone didn't work.) – ulty4life Oct 03 '12 at 18:12
  • 97
    The next error will be **Not Found** . To fix it go *Add and remove programs* find your *Web Deploy* click *Change* then install all features. – Cihan Yakar Apr 08 '15 at 07:02
  • 2
    I had the same error on Window Server 2012 R2 and Web Deploy 3.6. The problem was webdeploy wasn't completely installed at first it asked to restart the machine. So when I restarted the server and launched [WPI](http://www.microsoft.com/web/downloads/platform.aspx) again the installation continued and everything worked. But after restart the WPI won't start so I had to launch it manually. Hope this will help some seeking similar problems. – vendettamit Jan 25 '16 at 19:35
  • 4
    Other resolutions include uninstalling Web Deploy 3.6 and installing 3.5. Worked for me: http://stackoverflow.com/questions/32004797/error-the-configuration-section-system-webserver-management-delegation-canno – Derrick Jan 24 '17 at 14:29
  • 6
    What made me laugh is that after spending an hour or so following all of the MS doc Web Deploy installation articles and Troubleshooting Web Deploy articles word-for-word, none of them mentioned that simple checkbox _"Enable Remote Connections"_ and you **STILL** have to do that _Add and remove programs_ fix. smh. Fail. – frezq Feb 17 '19 at 18:06
  • 1
    @CihanYakar You earned a cookie from me. Thank you. – Zach Mar 27 '19 at 13:44
  • I had the same problem but I already had the checkbox "Enable remote connections" checked. So, I solved just restarting "Management Service". – Alielson Piffer Sep 30 '19 at 15:04
  • In my IIS there isn't "Connections" list but "Management Service" – Evilripper Nov 20 '19 at 10:14
  • Please take a look at Lee Gunn's answer below, saved me a lot of time: https://stackoverflow.com/a/48283631/10307728 – orangecaterpillar Apr 09 '20 at 18:30
  • What a pain in the a** of a program. Should have stayed with the file copy deployment option, but once you've started the process you don't really want to give up. – dodgy_coder Aug 10 '20 at 08:35
  • @CihanYakar Are you a wizard?! – JOATMON Sep 02 '20 at 15:51
7

Web Deploy can give you a whole bunch of errors if not setup correctly. Do yourself a favour and use the Web Platform Installer (https://www.microsoft.com/web/downloads/platform.aspx). You should uninstall WebDeploy first if you've already tried to install it. From the WebPI select: "Web Deploy 3.6 for Hosting Servers".

Lee Gunn
  • 7,319
  • 3
  • 35
  • 30
  • 5
    Had the same problems 6 months later. Just read my own answer and installed "Web Deploy 3.6 for Hosting Servers". Everything works first time :) – Lee Gunn May 30 '18 at 08:02
  • 1
    This worked for me, I had installed "Web Deploy 3.6" From **Web Platform Installer**, the key was uninstalling that and installing "Web Deploy 3.6 for Hosting Servers" instead. Worked right away, thanks! – orangecaterpillar Apr 09 '20 at 18:28
2

I had the same problem. Talk about jumping through hoops... The solution requires set up of user and deployment permissions etc.

  1. after getting the error 'NOT FOUND' as predicted by Cihan Yakar above, I had to change webdeploy (for me it required re-download search for 'WebDeploy_x64_en-US.msi') enabling all options.
  2. got a new error, always good, ERROR_USER_NOT_AUTHORIZED_FOR_CONTENTPATH. for this I looked at the web deploy errors (see below for link).

Diagnosis - A non-administrative user attempted to perform an operation with a Web Deploy provider for which the user is not currently authorized. Resolution - Web Deploy 2.0 setup, by default, creates Management Service Delegation Rules which allow non-administrators to perform operations with this provider. It is possible that a delegation rule required for this provider has not been setup correctly. Workaround: From the Programs Control Panel, run Repair on Web Deploy 2.0. Alternatively, create the delegation rule manually.

It turns out I had to create it manually from 'Configure the Web Deployment Handler'(see below for link), using this guide to 'Configure WMSVC and IIS Manager Permissions' and 'Create Delegation Rules for Web Deploy Users' sorted the problem.

notes: Diagnosed using 'web deploy error codes' from: http://www.iis.net/learn/publish/troubleshooting-web-deploy/web-deploy-error-codes and eventually configured using processes from 'Configure the Web Deployment Handler': http://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler

skrunkle
  • 21
  • 2
  • 3
    All the sequence of problems solved in one post, this helped. Also there is another work around, i have uninstalled web deploy and re installed along with IIS: recommended configuration from Web Platform Installer. – hakuna Jun 13 '17 at 17:49
  • I'm stuck on your #2 ..and i can't for the life of me figure it out. you don't happen to remember any "gotcha's" do you? i've been working on resolving this error for about 6 hours now... and i used your two links extensively during it. i just don't know what else i may be missing. – Napoli Mar 26 '21 at 14:20
1

In my case, after Enable remote connections checkbox, I need to reinstall Web Deploy to make it work.

Hoang Tran
  • 699
  • 2
  • 11
  • 21