Internal Server Error with httpHandlers section of web.config

Today I encountered titled error when I was deploying IIS6 hosted application on IIS8. On browsing the application all it displayed me is 404 page and I was not able to run the debugger to check the application code.

Internal Server Error with httpHandlers section of web.config

After hours of struggle I found the solution, and would like to share it with you.

The issue was with Web.config httpHandler settings. Here is the configuration settings I was using on IIS6.

    <httpHandlers>
      <!-- Handler for School Details -->
      <add verb="*" path="vp/*.aspx" validate="false" type="eBellUI.Custom.eBellPageHandler, eBell.UI" />
    </httpHandlers>

Now, IIS7+ uses <system.webServer\handlers> instead of the IIS6 <httpHandlers> section. So, this will throw an error by default if you have the settings in the older way.

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="eBellPageHandler" verb="*" path="vp/*.aspx" type="eBellUI.Custom.eBellPageHandler, eBell.UI" />
    </handlers>
  </system.webServer>

The validateIntegratedModeConfiguration="false" will allow you to keep your httpHandlers section populated without throwing an error (useful if you are debugging on a cassini / iis6 server) and the entry in the <handlers> section will configure it for your IIS7 server.

Hope this helps you to save time.

Comments

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System