Error: Creation of the virtual directory http://localhost/web failed with error: Could not find the server 'http://localhost' on the local machine. Creating a virtual directory is only supported on the local IIS server.
This error appear as a dialog box when trying to load a project whose virtual directory had been created formerly.
Actually, there are two dialog box:
1. The first dialog box sounds: The local IIS URL http://localhost for Web project web has not been configured. In order to open this project the directory needs to be configured. Would you like to create the virtual directory now?
2. After clicking yes, the second dialog box appears: Creation of the virtual directory http://localhost/web failed with error: Could not find the server 'http://localhost' on the local machine. Creating a virtual directory is only supported on the local IIS server.
Solution:
The solutions may vary in this case. Here are some possible solutions:
1. Make sure the asp.net is already registered to the IIS. You may want to try registering it to IIS
2. The virtual directory of the project might not have been set properly, so it can not be loaded. Edit the virtual directory of the project by right-clicking the project, choose Edit project (.csproj) file, then at the bottom part of the file, you may find something like <iisurl>http://localhost/</iisurl>
Change / add the name of the web project, e.g. <iisurl>http://localhost/webname</iisurl>
3. Make sure the IIS is running well on services.msc. To check it, press windows + Run, type "Services.msc" (without quotes), then restart IIS Admin.
Afterwards, restart the IIS by pressing windows + Run, type "inetmgr" (without quotes), then start the service.
4. This is a rare case, but someones might encounter it too. If you are using another web server on your computer, e.g. Apache, xampp, etc., make sure you stop the web server first, then start the IIS. In a case I met, it still didn't work, after about half an hour trying to find the problem, I found the issue. Someone changed the port used for the web server. So, I had to change it again.
On the IIS window, right click on the Default Web Site, choose Properties, then make sure the port used is 80 (I'm not sure if using another port is ok here).
Wednesday, September 30, 2009
You may be intersted in
Related Posts
Updating Table Containing Xml Column via LinkedServer
If you are trying to update a table containing XML column via Linked Server in SQL Server, and you are not able to, you are not alone. There...
This is a rare case, but someones might encounter it too. If you are using another web server on your computer, e.g. Apache, xampp, etc., make sure you stop the web server first, then start the IIS. In a case I met, it still didn't work, after about half an hour trying to find the problem, I found the issue.
ReplyDeleteHear hear ^^ What was the solution to your problem? Care to share it? :)
ReplyDeletenice post, thanks
ReplyDeleteThanks man, in my case the iisurl was pointing to https and in the iis website config protocol was in http, when change the iisurl to http all worked fine but... how do I change my website properties so it can support https?
ReplyDeleteHi, friend, I do not quite know about this issue, but after searching in google, I find some articles which you may find useful. Check it out at http://support.microsoft.com/?id=324069 and http://support.microsoft.com/?id=298805 ^^
ReplyDeleteGood Luck ;)
nice post!
ReplyDeletemy problem was port number :-/
when I changed port to 80, everything was fine...
Glad it helps :)
ReplyDeleteThanks, I migrate project from windows 7 to XP, I found same error, I found in .csproj file
ReplyDeletehttp://localhost:8080/webname
after that I removed ":8080" changed as
http://localhost/webname
now its working fine!
iis express will not work from visual studio if you are lacking visual studio sp1.
ReplyDeleteOn the IIS window, right click on the Default Web Site, choose Properties then set IPAddress section to -> (All Unassigned)
ReplyDeleteThanks for the sharing :)
ReplyDeletethank you so much...Really appreciate ur help. Very well explained...
ReplyDeleteI fixed it!! My case was, I had 127.0.0.1 bound but not "localhost" so it wasn't resolving correctly. I simply added another binding and it worked! :D
ReplyDeleteGood that you've found your problem. Thanks for the sharing :)
ReplyDeleteanother issue is missing service pack and update.
ReplyDeleteI solved mine by install VS 2010 SP 1 and 2012 Update 1.
great post, I am interesting in it!
ReplyDeleteThank you.. This is very helpful. .Tableau Online Training Hyderabad
ReplyDelete