SOLUTION - HTTP Error 500.19 - The requested page cannot be accessed because the related configuration data for the page is invalid

Topics: General, Installing Orchard, Troubleshooting
Nov 22, 2014 at 9:00 PM
Hi Orcharders -- I thought I would post this solution here as 1) this was a super frustrating situation, and 2) it could happen again. Possibly to me. For future posterity, here is the fix.

ISSUE: a fresh build of Orchard was giving me the asp.net error screen with the error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid

WTF? I monkeyed around with permissions on the directory, studied the web.config file - nothing worked. Then I noticed in the error:

Config error: \?\d:\Documents\My Web Sites[blah blah a path I never use]\web.config

Wait a minute! That's not where my source is living! Not even close.

So - turns out the IIS Express applicationhost.config file can store rotten data. Under the <sites> node, there is a <site> child for each of your VS solutions running in IIS. The one I had was pointing to D:\Documents\My Web Sites[blah blah]. So - I deleted that node, re-launched the site and voila - working.

Several hours were lost to this stupidity, so here's a possible solution to save you, poor Orchard (or other asp.net MVC app) developer from the future.

You're welcome.

Kurt