November 27, 2011

Asp.net MVC requested page cannot be accessed because the related configuration data for the page is invalid.



HTTP Error 500.19 - Internal Server Error

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


Description: i got this error when i tried to deployed the asp.net mvc application on the IIS 7.5. As IIS 7.5 is very different from IIS 6.0 some setting also differ.
It was working perfectly on IIS 6.0

System Configuration on which this error occurred

Windows 7 64 bit
IIS 7.5
Asp.net 2.0/3.5 with MVC 2,3


Solution: it worked for me, it may also work for you.


Go to browser, on error page check the section "Config Source"


you will find error in specific section.
for example my error was


<system.webServer>
 <handlers


do following as per your error 

1) first go to following location
    C:\Windows\System32\inetsrv\config
2) Open the application "applicationHost.config"


go to particular section in my case


<sectionGroup name="system.webServer">
  <section name="handlers" overrideModeDefault="Deny" />


Change overrideModeDefault="Allow"

3) Reset IIS 


You may also have to perform following in addition to above step. but following steps are optional. 


b)  Set application pool to 32 bit:
  • Open IIS, 
  • Select application pool option, 
  • Now on right side select the desired app pool, 
  • Now on right side bar. select option: "Advanced Settings..." 
  • There is option "Enable 32 bit application" set it to true:
  • Now press ok.., Reset IIS
c) Set "managed pipline mode" to Classic:
if step a does not work. perform following.
  • Double click the application pool
  • select classic in  "managed pipline mode" option.

No comments: