No More Solutions

You can find a lot of debugging and deploying problems while developing applications in .NET and Visual Basic here. There are also some querying tips in SQL and typical source codes which might be useful shared here.

Fail creating virtual directory

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).

Bookmark and Share

16 comments:

  1. batu permata said...
     

    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.

  2. Steven Luck said...
     

    Hear hear ^^ What was the solution to your problem? Care to share it? :)

  3. lirik lagu said...
     

    nice post, thanks

  4. Anonymous said...
     

    Thanks 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?

  5. Steven Luck said...
     

    Hi, 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 ^^

    Good Luck ;)

  6. Anonymous said...
     

    nice post!

    my problem was port number :-/
    when I changed port to 80, everything was fine...

  7. Steven Luck said...
     

    Glad it helps :)

  8. Balater said...
     

    Thanks, I migrate project from windows 7 to XP, I found same error, I found in .csproj file
    http://localhost:8080/webname

    after that I removed ":8080" changed as
    http://localhost/webname

    now its working fine!

  9. Anonymous said...
     

    iis express will not work from visual studio if you are lacking visual studio sp1.

  10. Anonymous said...
     

    On the IIS window, right click on the Default Web Site, choose Properties then set IPAddress section to -> (All Unassigned)

  11. Steven Luck said...
     

    Thanks for the sharing :)

  12. Anonymous said...
     

    thank you so much...Really appreciate ur help. Very well explained...

  13. Anonymous said...
     

    I 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

  14. Steven Luck said...
     

    Good that you've found your problem. Thanks for the sharing :)

  15. Anonymous said...
     

    another issue is missing service pack and update.
    I solved mine by install VS 2010 SP 1 and 2012 Update 1.

  16. buy wow gold said...
     

    great post, I am interesting in it!

Post a Comment