34
votes

I have a remote Windows 2012 server running IIS 8 from which I am hosting a web application. My local development box is running Visual Studio 2012. Currently I am publishing my app as a web deployment package (.zip), RDP'ing to the production server, copy + pasting to a folder and deploying the application from within IIS. My question is, what changes do I need to make to deploy directly to IIS from Visual Studio 2012 using the web deploy option?

I have tried to follow this guide but it refers to a service URL which I must obtain from my hosting company. I don't have a hosting company, my server is co-located.

I am presented with the following options:

Web deploy options

Is the username and password the one I use for the RDP account? I already have Web Deploy 3.0 installed on IIS do I need to enable further settings?

2
If you found the solution it is better to post it as an answer to your own question.angularrocks.com

2 Answers

39
votes

OK I found the solution but it took me a whole day to get it working! Basically the steps are as follows. This is very sketchy but see the detailed guides below which helped me.

  1. Enable the IIS Web Management role feature.
  2. Install Web Deploy 3.0 (or higher). Make sure to customise the install to include the handlers (See notes below). If you're not presented with this option go to add/remove programs, find webdeploy, right click and select "change" option.
  3. In IIS click on the server node and find the "Management Service" icon. Enable remote access and configure a dedicated IIS User for remote deployment (These will be the credentials that will go in the user name and password boxes).
  4. At the site level in IIS assign this user to manage the website.
  5. Make sure port 8172 is open on the web server (you can check this port here).
  6. Try reconnecting from Visual Studio. There was some trial and error here for me but the error messages do link to a MS guide for decoding :)
  7. Even after connecting successfully I had to wrangle with permissions, so my IIS user had sufficient privileges to create the app pool, directories and general file management jobs.

The following links really helped!

Configuring the handler on the web server:

http://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler

Connecting via Visual Studio:

http://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx

NOTES:

To ensure the handler is running, login into your IIS server and point your browser to the following URL.

https://<servername>:8172/MsDeploy.axd

F12 to open up the dev tools to see the HTTP response. Also MsDeploy also creates IIS logs in inetpub/logs which should give you some clue if you're having connectivity problems.

2
votes

I had the same problem and this post was very useful to help me solve the issue. I had anyhow serious troubles while trying to install Web Deploy on my Windows Server 2012. The installation of Web Deploy 3.0 was giving me several errors and it couldn't be completed.

I tried to solve the problem installing "Microsoft Web Platform Installer 5.0" from http://www.microsoft.com/web/downloads/platform.aspx but it didn't solve it.

I thought it was due to Firewall Settings, Authorizations issues, Users without permissions or something like that. Finally I found out it wasn't due to any of the mentioned reasons.

I found the most simple solution and I hope it will help other users too: it was enough to download Web Deploy 3.5 installation directly from Microsoft Website:

http://www.microsoft.com/en-us/download/details.aspx?id=39277

This may sound banal but it solved it. I was able to install "Web Management Service" but not the second needed IIS service "Web Deployment Agent Service".