scriptresource.axd 404 error in asp net 4 applicat

2019-02-08 04:41发布

Hey everyone, I have a .net 4 application that i just deployed to production. The app loadas fine, except my referenced js files arent loading properly. Using fiddler I found that the ScriptResource.axd calls are returning 404 errors.

Heres the kicker, the page is also making a call via WebResource.axd, and that request works just fine.

Any ideas what I can check for? Were running IIS7. It is load balanced, but we have machinekeys in the config. I added an httpHandlers section for scriptresource.axd.. but Im still having the same issue.. stumped...

Update - we think ou websrver has no idea what an axd file is. Is there any install for .net that will install the axd mappings in iis?

11条回答
淡お忘
2楼-- · 2019-02-08 05:37

For me, all AXD files were failing. After spending an entire week, trying every answer found on Internet, with no luck:

I created empty files ScriptResource.axd and WebResource.axd, and it solved the issue. I would love to know what the real issue was.

查看更多
小情绪 Triste *
3楼-- · 2019-02-08 05:39

This worked for me:

Add the below handler to your web.config:

<system.webServer>
<handlers>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode" />
查看更多
神经病院院长
4楼-- · 2019-02-08 05:42

"404" could also mean (under certain conditions) a "Not enabled" or "not allowed". I had that some time back on a server and had to enable some extension.

Another way would be to use Process Monitor to see whether real files are being searched by the IIS process and not found.

查看更多
贪生不怕死
5楼-- · 2019-02-08 05:42

Check that the time on the server is not set to before the time the site was published.

查看更多
可以哭但决不认输i
6楼-- · 2019-02-08 05:45

Solved it by adding

<system.webServer>
  <handlers>
    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
查看更多
登录 后发表回答