WebDeploy again and IIS setup issues


Went thru setting up a new server with Web Deploy. once again (and it feels like I’ve posted on this a dozen times, but it’s probably only about 10) I walked thru the following:

  1. Remote desktop onto the box.
  2. Setup Google Chrome so I could get around IE’s insane “trusted sites” security-through-obstruction policies.
  3. Installed Microsoft Web Platform Installer 4.6.
  4. Used this tool to install Web Deploy 3.5.
  5. Used WPI to set up IIS Recommended Configuration

At this point I was able to go into Visual Studio and deploy a website out to the Default Web Site\{MySiteName} folder that I created. Yay! IIS_IUSRS had sufficient privileges, etc.

Still though I was getting this error message:

Which was odd.The “ASP.NET is not installed” note is a dead giveaway. My first thought was that we were missing some security settings or a key component. But no, everything looked jake:


I tried an admin command prompt and reregistering aspnet_regiis as follows:

c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i


… but had forgotten that in Windows Server 2012 this is done with the “Turn Windows Features On and Off” app. So, I ran that – and lo and behold, a few key things that ASP.NET 4.5 needs weren’t set up initially:


I guess this is what happens when someone else “sets up” a server partially (sigh). Easy to fix though. After the setup of these missing roles, voila – suddenly I could (without a restart even!) browse to my site locally, and remotely. Easy!


More WebDeploy adventures in Visual Studio…

Here’s a more coherent chain of events for setting up WebDeploy:

  1. Set up IIS (in Windows 8 this is done thru the “Add roles and features” in the Dashboard part of Server Manager. Very nice!) Also make sure ALL the features for .NET Framework 4.5 are set up.
    1. While you’re there, use Search to find inetmgr and add it to your Start/taskbar.
  2. Open up IIS and R-click once you expand Sites\Default Web Site to the wwwroot folder (typically c:\inetpub\wwwroot).
    1. Create a folder named after your website.
    2. Back in IIS, R-click on the folder name under Default Web Site and select Convert to Application.
  3. Note – it’s at this point that I hit an issue with the overly strict security settings in IE on the Windows Server 2012 QA/PROD boxes. So, to get around this, we abandon crappy IE and cut over to Google!
    1. Open up IE tools menu and add https://dl.google.com and www.google.com to the list of Trusted Sites.
    2. Go to Google.com and download Chrome. Ah, THAT’S better! So long IE!!!!
  4. Download the Web Platform Installer (this should be a part of IIS; it usually will prompt you to run it if you open up inetmgr from scratch).
  5. In the Web Platform Installer I made sure – in the Frameworks tab – that the ASP.NET MVC 4 was set up (along with .NET Framework 4.5):

  6. I also made sure that the IIS Recommended Configuration and the Web Deploy 3.5 options were set up:

  7. If you’re prompted above for Web Deploy 3.5, the Typical configuration is fine.
  8. Time to doublecheck. Open up Control Panel, Administrative Tools – and make sure that Web Deployment Agent Service is running.
  9. If you open up your new {websitename} folder under wwwroot, you’ll also see that IIS_IUSRS for the local machine has read/write privileges. Excellent!
  10. Now back into Visual Studio, and select Publish. Give your profile a name…


The Databases section is interesting – here’s where you can replace on publish your connection strings with the correct database entry for QA /PROD, and test connection strings.


  • Note that if you’ve set up IIS before installing ASP.NET Framework 4.5, you MAY need to run aspnet_regiis to register the framework with IIS. (I didn’t have to do that). If you come across this issue, check some of the notes here.
  • You also want to make sure in the Settings section that you select the checkmark to Delete Additional Files upon Publish. In old-school x-copy deployment terms, this means the same thing as deleting the destination (target) folder before you copy over files.

Found some good notes here on setting up IIS on a completely blank IIS server: http://www.iis.net/learn/get-started/whats-new-in-iis-8/installing-iis-8-on-windows-server-2012. It really is (relatively) painless compared to what it used to be; typically your issues will be insufficient permissions on the local machine/network to handle remote connections.


Web Deploy hijinks

I always used to do a file system x-deploy to copy a web app from local out to QA/PROD. But that involved manually changing the web.config and is fraught with manual steps (i.e. errors). So, if you’re getting errors on running deployments, try the following to access Web Deploy 2.0

  1. Remote desktop onto the target IIS webserver
  2. Go into IIS Manager
  3. Right click on the site, and select Deploy, “Configure Web Deploy Publishing”
  4. Click on Setup – > it will create a PublishSettings file locally on the desktop. Copy this to your local system and use this in Visual Studio (manage publish settings in Publish)

Web deployment notes: http://blogs.iis.net/msdeploy/archive/2011/04/05/announcing-web-deploy-2-0-refresh.aspx

From this article – find out if your settings are correct:

  • Click on the Web Site in IIS – select Features tab.
  • IIS Manager permissions icon.
  • IIS Manager Permissions, Action, Allow User – and add your user name.