HTTP Error 500.19 - Internal Server Error

Problem

You get this error when first running your application:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

The Server Error 500.19 refers to a section or folder that cannot be used because it is locked.

Unlock the section

Step 1:  Run the administrator level command console (cmd).  Even if you are logged onto  your computer as an administrator, just running cmd will not do it, since it defaults to non-administrative rights, so, enter “cmd CTRL+Shift+Enter” to get into the administrative mode,

Step 2:  Run the appcmd.exe program to configure/unlock the desired sections, e.g.:

To unlock the modules section, enter:

%windir%\system32\inetsrv\appcmd.exe unlock config /section:system.webServer/modules

To unlock the handlers section, enter:

 %windir%\system32\inetsrv\appcmd.exe unlock config /section:system.webServer/handlers

Step 3:  Each section that is locked will be identified in the application web.config file and you can tell the progression to reach it by looking at how they are structured with it.  To unlock request filtering, which is under the security section, enter:

%windir%\system32\inetsrv\appcmd.exe unlock config /section:system.webServer/security/requestFiltering

If you use the command sequence above, you will unlock these sections globally.  If you only want to affect a specific site, then you can run it against that site’s directory and URL on IIS.  Please note that there are usually multiple sections that will need to be unlocked, so after running the command, re-run the app and check the details on the error message to make sure that you get them all.

Grant read and execute permissions to your application folder

Give Read & Execute Permissions to the NETWORK SERVICE user for the folder containing your application.

Step 1: Open Windows Explorer and go to the folder containing your application.

Step 2: Right-click the application folder and select Properties.  Then click the Security Tab.

Step 3: Click Edit, Click Add, enter NETWORK SERVICE and press OK.  Then, select “Read & Execute” and press OK to apply the settings.

Additional details and suggestions

http://forums.asp.net/t/1129523.aspx

http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/

See Also

Part VII:  Troubleshooting Applications

Application Will Not Run

Application Runs But No Data is Displayed

Application Error Messages