Sunday 13 October 2013

Visual Studio : Creation of the virtual directory http://localhost failed


When creating a copy of an application from Visual Source Safe, sometimes developers get the following error message :
The local IIS URL http://localhost/ specified for Web project DemoWebsite 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?
After clicking ‘Yes’, a new error message will be displayed:
Creation of the virtual directory http://localhost/ failed with the error: The URL ‘http://localhost/’ is already mapped to a different folder location.
All the projects will be loaded expect for a project which states unavailable and by right-clicking the project and selecting the option of editing the file with an extension of either .csproj or .vbproj.
In the file, find <iisurl> tag with localhost.( <iisurl>http://localhost/</iisurl&gt;) Change the tag details to your application name (<iisurl>http://localhost/yourapp</iisurl&gt;). Reload the project and you should be able to load the project now.