0

My application has always worked fine but suddenly we have started getting above error in one part of your application.

As its MVC application, MVC create webconfig file for every Areas. I have compared webconfig file from area(s) which work with my error area and its absolutely same.

Did anyone had this problem in MVC application where one part of website is giving this error and other parts are working ok?

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

I have IIS7.5 on my machine and I have tried microsoft website and tried their solution but none seems to work for me.

Problematic Webconfig:

<?xml version="1.0"?>
<configuration>
  <configSections>
 <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
  <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
  </configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
  <namespaces>
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
  </namespaces>
</pages>
 </system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<httpHandlers>
  <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<!--
    Enabling request validation in view pages would cause validation to occur
    after the input has already been processed by the controller. By default
    MVC performs request validation before a controller processes the input.
    To change this behavior apply the ValidateInputAttribute to a
    controller or action.
-->
<pages
    validateRequest="false"
    pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <controls>
    <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
  </controls>
</pages>

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
  <remove name="BlockViewHandler"/>
  <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>

UPDATE It happens only on our local machines (we have recently started working in 2013, can that be an issue )

Jay
  • 1,037
  • 5
  • 23
  • 41

1 Answers1

0

Here is a helpful link from msdn blog listing various 500.19 scenarios and solutions. Hope it helps. http://blogs.msdn.com/b/webtopics/archive/2010/03/08/troubleshooting-http-500-19-errors-in-iis-7.aspx

Update: Have you checked your handler mappings under Feature Delegation in IIS? Select your server node in IIS, in "Features View", Open "Feature Delegation" and see if "Handler Mappings" is set to "Read Only". According to this previous post in stackoverflow, (forgive me stackoverflow people, for posting another link, albeit to your site :), settings this value to "Read/Write" solved this same issue. Credit goes to 3-fixed-stars on this one.

Community
  • 1
  • 1
amadbear
  • 96
  • 6
  • My friend, i have written in my question that i have tried Microsoft solutions and none worked for me. Thanks – Jay Feb 18 '14 at 16:57
  • Sorry Jay. Could you post some of the other details related to the error message, perhaps error code? – amadbear Feb 18 '14 at 17:01
  • Hi, and welcome to Stack Overflow. Link only answers are typically not recommended, as the links can sometimes change. Please include pertinant details in your answer along with the link. See the http://stackoverflow.com/faq for more information. – Mike Gardner Feb 18 '14 at 17:12
  • http://i60.tinypic.com/11b5ama.jpg , the webconfig entry in pic you see is not of parent. above is the webconfig where it error.. – Jay Feb 18 '14 at 17:29