I was running into this issue in VS2008 after I did a "get latest" out of TFS. VS wanted me to create the virtual directory, although it already existed. I said no the first time, but then the project wouldn't display in VS. So I said "go ahead and make the directory."
After the directory was created I started getting the "Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information" error message.
For me it ended up being that when the new virtual directory was created automatically through VS, it created incorrect IIS configurations.
There are multiple projects in my solution, and for each one I had to do the following steps:
- right click the project.
- select "properties".
- select the "web" tab.
- ensure that "Use local IIS Web server" was selected.
- change the "Project Url" path to be what it should have been.
I also had to reconfigure the IIS settings because of the recreation of the virtual directory. I did the following for each directory created:
- open IIS.
- right click on directory.
- go to "Manage Application"
- go to "Advanced Settings"
- corrected the "Physical Path", as that had changed to something
that was not correct.
After I did these it worked correctly.
There are also more suggestions I found on this site, but none worked for me.
http://www.aspdotnet-suresh.com/2011/07/unable-to-start-debugging-on-web-server.html?showComment=1363115311254#c1277193809542815038