I got this error when I was trying to build a website and view it in browser like we do in windows XP, IIS6 and IE6.

However, my new settings had IE7, Windows Vista, IIS 7 and Visual Studio 2008. After spending 2 hours or more with exhaust I came across this ASP.Net forum gave a hint.

Answer
After making or attaching a website, you need to publish it. Which will pre-compile your site. (publishing your website will publish locally IIS7, don’t know why its required but you need to do this not externally so nothing worry about that).

If someone else wants to explain or discuss further into the roots of problem please do so…