Visual studio unable to create the virtual directory IIs7

Posted : Thursday, 15 November 2012 10:50:00

I recently started a work on new project for a client with whom I’ve done a fair amount of work over the years. My current task set contains a number of required alterations to an existing line of business Silverlight application. I’m no Silverlight jedi but I can hold my own – particularly when the developer responsible for implementing the system did such a good job. Its a WCF RIA services MVVM app so anyone familiar with MVVM could just jump straight in and start fiddling.

Anyway I was at the client site the other day getting all the latest code for the application (been using GIT for a while and it seems strange to go back to TFS) when I came across a reasonably irritating problem that took way more time that it should have. The web application hosting the Silverlight project needs to run using SSL so the project itself needs to use IIS when running in Visual Studio. I added a local dev alias to my hosts file and entered the same value in the “Project Url” field of the project properties page in Visual Studio


On saving the page, I was prompted that a virtual directory will be created, I clicked Yes and got the following error:


This is embarrassingly one of those “you really should know this” type of things but I had forgotten to create a new website and and the host header binding to it in IIS:

1) Create new web site in IIS


2) Add host header


That simple!!!! Shocking – I think this comes from the fact my formative web-development years were pre IIS7 where you had to do everything using virtual directories. Personally I think it would be quite cool if VisualStudio could configure this automatically but I wont hold my breath for that one….

  • (This will not appear on the site)