Nick's .NET Travels

Continually looking for the yellow brick road so I can catch me a wizard....

Don’t Install Web Deployment Tool using the Web Platform Installer

After a bit of time wondering why I couldn’t just hit Publish on my web application within Visual Studio 2010 and have it deployed using the new Web Deployment Tool I tracked it down to some missing bits. I’d just gone through the process of building a new development server and as part of setting up the services I need I used the Web Platform Installer. What I wanted to do was configure the server so that when I create a new web project on my development machine using VS2010 I could then use Publish from within VS to deploy it to my development server. Having read through a couple of blog posts on how to do this I figured it can’t be that difficult since most of them say “install the Web Deployment Tool using the Web Platform Installer” and then Publish away. Well it isn’t that easy basically because the platform installer only installs half the bits.

Installing WebDeploy and Management Service

Ok, so lets start with the bits you do need to make sure you install. These are the Web Deployment Tool (of course) and the Management Service (not so obvious but kinda required if you want to remotely publish your applications to IIS).

image image

Now the next thing to do is to go and actually install the Web Deployment Tool from the MSI. You can do this by downloading it from http://www.iis.net/download/WebDeploy. This should prompt you to change, repair or remove – select Change and install the missing components. This will give you the bits in IIS Manager to actually manage permissions and delegation so that you can remotely deploy your application.

So far you’ve been doing the default install for the Web Deployment Tool which uses port 80…. but wait, isn’t that what your website is running on? If it is, then you need to customise your install, for example:

msiexec /i <msi_filename> /passive ADDLOCAL=ALL LISTENURL=http://+:8080/MSDEPLOY2/

Alternatively, if you’re like me and only building a dev server then you could always just change your web site (within IIS) to run off a different port. In my case I created a new Web Site using port 8080, which meant I just went with the defaults for webdeploy.

Remote Access

Select the Web Server node in IIS Manager followed by double-clicking the Management Service icon. Stop the Management Service from the Actions list – this will enable the Enable Remote Connections checkbox. Check the Enable Remote Connections checkbox. You can configure other options such as the port and the SSL certificate to use. You need to make sure there is an exception in the server firewall for the port used by the Management Service. By default the Management Service uses a self signed certificate – this isn’t an issue if your doing internal deployments and the clients don’t care about ensuring the integrity of the server they are communicating with. If you are exposing it out of your network you should change the certificate. Start the Management Service from the Actions pane.

image

Configure Deployment Account

The next step is to set up the Management Service for remote deployment of your web application. In my case I set up a Windows user, WebsiteDeploy, that belongs to the Administrators group. This is the user that will create the application within IIS on the server when you publish your web application.

Within IIS Manager select the Web Site you want to enable remote deployment for. Double-click the icon entitled IIS Manager Permissions in the Feature View when the Web Site is selected. From the Actions list select Allow User and enter or select the name of the user that you want to enable (in my case WebsiteDeploy).

image

Delegation

Now that you have enabled the user you need to delegate remote access to that user. You do that by selecting the web server node and double-clicking the Management Service Delegation (this icon doesn’t appear if you only use the Web Platform Installer to install the Web Deployment Tool). Select Add Rule from the Actions list and then select Deploy Applications with Content. If you only want to deploy content then you can select the Deploy Content Only option.

image

I went with the default values and that seems to work for the new rule.

image

You may need to restart the Management Service which you can do by reselecting the Web Server node in IIS Manager, select the Management Service feature and then click Restart from the Actions pane.

You should now be ready to deploy from within Visual Studio 2010. To test this capability I created a new web application, WebApplication1, based on the ASP.NET Web Application. Without making any changes to the application I right-clicked the Web Application project node in Solution Explorer and selected Publish.

image

You’ll notice that all I needed to enter for the Service URL was the ip (or machine name) of the server you are deploying too. Of course this does rely on the Management Service port (default is 8172) being open on the firewall of your server. Also, don’t for get to Allow untrusted certificates unless you configured the Management Service to use a trusted certificate.

Hope this helps you get your server set up for One-Click Publishing. Let me know if there are pieces missing that I may have overlooked.

Comments (4) -

  • Shielded Cables

    16/08/2010 9:26:35 AM |

    Hey I am an IT help desk guy, I read the post, its really nice post. Thank you for sharing the information with all, I have take your link and share with my friends

  • design courses

    4/09/2010 3:47:54 AM |

    Actually it can configure other options such as the port and the SSL certificate to use.

  • mylifeandcode

    11/11/2010 1:52:27 PM |

    Thank you so much for posting this. I spent hours today trying to figure out why the Export and Import options weren't appearing in IIS. Tried repairing the Web Deployment Tool install, but that didn't do the trick -- selecting Change did. Thanks again!

  • Richard

    18/11/2010 4:35:08 PM |

    Great post.

  • Network Management Service

    28/12/2010 1:17:25 AM |

    Very good information as I was thinking of installing web deployment tool here.

  • Benjamin Howarth

    21/01/2011 4:18:33 AM |

    Perfect, just was I was after for our new server farm. Thanks!

  • Web design India

    4/02/2011 2:20:51 AM |

      Came across your blog and I must say, it really impressed me. The amount of topics you guys have managed to cover has left little scope for the imagination. Do you guys invite people make guest posts too?

  • slot machine free games

    8/02/2011 12:33:43 AM |

    Thanks for the informative article.I love the way by which you have expressed.

  • freelance writing jobs

    21/02/2011 4:36:22 PM |

    Deploying your web application to a server is something that all (successful) projects need to do.  Without good tools to help you, deployment can be a cumbersome task – especially if you need to do it manually.

  • dorm bedding

    11/03/2011 4:39:31 AM |

    Dorm Bedding is the most difficult item to find when students and parents shop for college. We

    take the hassle out of college shopping, just log on to our website and order your new dorm bedding set.

    We can ship it to your home so you have it with you to take to your residence hall or we can ship it

    directly to your dorm room.

  • Amit

    15/03/2011 2:40:24 AM |

    Great Post

  • Home Improvement and Interior Design

    21/05/2011 8:10:58 PM |

    I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!

Comments are closed