WebResource.axd not found

Paul Knopf picture Paul Knopf · Dec 12, 2011 · Viewed 29.7k times · Source

I can't get script files to load on my website. Everything else works fine. I haven't tried ScriptResource.axd however.

I have verified this issue exists on both cassini and IIS7.

I have verified my 64bit 4.0 web.config contains the mapping for WebResource.axd.

My system time is correct (I heard there may be issues with that).

I have verified that it works in other projects, so the culprit has to be my web application.

My web application is 4.0 MVC3 web application.

My web.config can be found here.

This error is killing me! Any help would be appreciated!

Resource not found

Answer

CedX picture CedX · Dec 18, 2011

Your web.config file is amazing (it's not a compliment): in .NET Framework 4.0, it should be much shorter/lighter.
I think that your handler is declared in the wrong section :

<system.webServer>
    <handlers>
        <add name="WebResource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
    </handlers>
</system.webServer>

Normally, the WebResource.axd handler is declared in "system.web" section :

<system.web>
    <httpHandlers>
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
    </httpHandlers>
</system.web>