Recently i faced a bizarre problem in IIS 7.0 where none of my configured local sites worked. Hitting the starting URL of each application took me to the general error page. Infact when i tried to check if IIS is running or not i tried with http://localhost. But no success i still got the same error page.
The IIS Manager was launched and checked if everything was okay? I found everything perfect over there. But still IIS was not working and none of my application was launching.
Then i tried several workarounds.
* Thought that binding of IIS might got lost so i fired the aspnet_regiis -i command from VS comand Prompt to re register the IIS with the lastest version of .NET.
* Uninstalled the IIS from the machine, then reinstalled the IIS. It did not work. Then again i executed the command above to register the IIS.
Inspite of trying everything possible as per my understanding it did not seem to work. Then i suddenly found that the Default Web Site is not running. So i tried to start it by right clicking on the default site node and then selecting the Start option from Manage Web Site.
Infact the situation got worse and i was staring another error pop up that looked like
That turned me crazy, as everything was working until last time. What i did that really crashed everything. I investigated and i found out that i created a new solution in VS 2010 and used the URL as it is that i was using to visit the application in IE. It contained the %20 in the root URL of the application. Web Browser replaces the space in the URL with the equivalent code that is %20.
That typographical error in URL caused all the problem.
I removed the Virutal Directory URL http://localhost/My%20Application from IIS by right clicking, selecting Remove. Then recreated one with correct Virtual URL http://localhost/My Application.
It then allowed to start the Default Web Site successfully and silently. Everything worked perfectly afterwards. I could see the default page of IIS start on hitting the http:/localhost. All my applications started working.
It seems that IIS does not like special characters in the Virtual Directory URLs. I will investigate it further as what was wrong with that encoded URL.