tags:

views:

1146

answers:

5

Why do all of my .axd files generate a 404 error when on our production server?

A: 

You need to create a MIME type for that extension in IIS:

To define a MIME type for a specific extension, follow these steps:

  1. Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
  2. Click HTTP Headers.
  3. Click MIME Types.
  4. Click New.
  5. In the Extension box, type the file name extension that you want (for example, .axed)
  6. In the MIME Type box, type application/octet-stream.
  7. Apply the new settings. Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect. In this example, IIS now serves files with the .axed extension.
Alex
Nope its not that. I have a feeling that the server is stripping out querystring parameters from .axd files and .asmx files as my webservices dont work either. Is anybody aware of something that would prevent this (no its not the verb missing from the extension as this generates a different error)
januszstabik
What version of IIS are you running?
Alex
I'm thinking you might have a permissions issue? Can you see anything else on that server? .aspx? Anything?
Alex
A: 

We had error 500(it is not 404, but who knows) on our production server some time ago. No script resources were able to load.

The problem was in the time difference between our development and production servers. It was -7 hours. .NET threw an exception because of it tried to use a "time in the future" of an assembly with embedded script resources.

Decreasing {website}/bin/ folder (actually assemblies' in it) creation date by day solved the problem.

Alex
A: 

Can you make a "bad" request that fails and then check the server's system and application event logs?

There are several issues around axd that can cause 404s or 500s (such as the "time in the future" issue mentioned by Alex), but they leave a footprint in the event log.

Have a look and post any log entries that mention axds.

Rob Levine
A: 

You can check the following:

  1. Check in the IIS management console that the .axd extension (the default HTTP handler extension) is allowed.
  2. Also check if the “Verify if file exists” checkbox is unchecked. This screen appears after you click the "Edit" button after selecting the axd extension.
  3. Check if the HTTP handler is correctly registered in web.config. It should also be in the right config section depending on the IIS version. For IIS6 and IIS7 Classic mode it should be in . For IIS7 Integrated mode it should be registered in .
korchev
+2  A: 

if you're on IIS7 make sure you add the handler to the <system.webServer><handlers> section:

<add name="MyName" path="MyName.axd" verb="*" type="NameSpace.Class, Assembly" />
this answer solved my issue
BozoJoe