ASP.NET MVC 2 & IIS : HTTP 500.24 Favicon.ico Error

I have a little weird behavior with my ASP.NET MVC 2 application.

I'm using IIS 7.5, Windows Authentication and ASP.NET Impersonation for my webpage to load.

After several searches, I didn't found a nice way to get rid of the 500.24 Request that I keep getting on every page load (The favicon.ico at the root directory triggers this) :


I've looked at some articles like this one or that one but this doesn't seems to solve my issue. I need these settings on for my application to work here : .NET 4 Framework Integrated Mode pipeline, Windows Authentification and ASP.NET Impersonation.

Here's a simplified version of my web.config, if it can help anyone (of course, I've removed the connections strings for security reasons..)

<?xml version="1.0" encoding="utf-8"?>
    <customErrors mode="Off" />
    <identity impersonate="true" />
    <compilation debug="true" targetFramework="4.0">
        <add assembly="System.Web.Abstractions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Data.Entity, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <add assembly="System.Data.Entity.Design, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <authentication mode="Windows">
      <!-- roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" / -->
      <!-- forms loginUrl="~/Account/LogOn" timeout="2880" / -->
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/Globe" />
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
    <roleManager enabled="false">
        <clear />
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/Globe" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add name="X-UA-Compatible" value="IE=edge" />
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="WebDAVModule" />
          <add verb="PUT" allowed="true" />
          <add verb="DELETE" allowed="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

My application IS working, the favicon.ico IS loading, I'm just wondering why it does fires a 500.24 on every request (Of course, maybe it's Fiddler who can't authenticate itself and causes de 500.24 HTTP Error, but when it does normally it triggers a 401.2 - Unauthorized instead...)



My guess is that favicon.ico is either running in a different application pool, or there is a web.config in the root of the site that has issues. So: 1) Check to see if the root of the site (the directory where /favicon.ico lives) includes a web.config. If it does, then check to see if it is setting a system.web/httpModule, or httpHandler, or system.web/identity (impersonate) or something like that, and the application pool is running in integrated mode.

So what you need to do is either remove the offending httpmodule/httphandler/impersonate setting, or change the application pool to run as classic, or add the same configuration your site includes which is <validation validateIntegratedModeConfiguration="false" />