Friday, 3 December 2010

How to fix the failure in creation of the virtual directory (localhost) in Visual Studio

If you have already set up a site for your project in IIS but getting an error like this when trying to open the solution in Visual Studio:

The local IIS URL http://localhost/ specified for Web project has not been configured. In order to open this project the virtual directory needs to be configured. Would you like to create the virtual directory now?"




and then when you clicked yes, getting the following error:

Creation of the virtual directory http://localhost/ failed with the error: The URL 'http://localhost/' is already mapped to a different folder location.





All you need to do is to right click on the project file(with .csproj extension) and open the file in a text editor and update the http://localhost/ to your mapping.

Check the following link for more info:
http://www.neilpullinger.co.uk/2008/07/creation-of-virtual-directory.html