7

I have a simple ASP.NET Web Site. When I try to run it on Windows 7 IIS, the following error message is displayed in my browser:

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

How can I solve this problem?

Web Site Error

2 Answers 2

8

When you get this error it means that there's probably something broken in your site's web.config file. IIS7 is very helpful in these cases and will usually point you roughly where the problem lies.

For example, I've deliberately broken a web.config on a test site by making it malformed XML:

enter image description here

The areas highlighted in red are providing me with a hint as to what is broken.

Without seeing the full error message from your site it would be hard to speculate what is wrong other than that something is invalid in your web.config file (or perhaps a parent web.config).

Update:

Based on your update and the new screenshot comment out the line indicated in red in your web.config file, e.g.:

<!-- <modules runAllManagedModulesForAllRequests="true"/> -->

It looks like this setting has been locked somewhere on your machine, probably in the applicationHost.config file in C:\Windows\System32\inetsrv\config.

You could try unlocking this setting to allow the web.config setting to be used by running the following on an Administrator command line:

appcmd.exe unlock config /section:system.webserver/modules /commit:apphost
3
  • I Add a Picture of Error ... Mar 26, 2011 at 14:12
  • @hosseinsinohe - I've updated my answer.
    – Kev
    Mar 26, 2011 at 14:34
  • 3
    Thanks for the solution @Kev. commandline to be specific %windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/modules
    – user123886
    Jun 7, 2012 at 9:54
1

The error is saying that you need to unlock the Modules configuration section in order for it to be overridden by the web.config file in the website directory.

Try appcmd.exe unlock config /section:system.webserver/modules /commit:apphost , or use the Feature Delegation user interface to set the Modules section to read/write.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .