.axd files generate a 404 error

后端 未结 9 2141
无人共我
无人共我 2020-12-31 08:32

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

相关标签:
9条回答
  • 2020-12-31 09:00

    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" />
    
    0 讨论(0)
  • 2020-12-31 09:06

    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 <system.web><httpHandlers>. For IIS7 Integrated mode it should be registered in <system.webServer><handlers>.
    0 讨论(0)
  • 2020-12-31 09:10

    If this will help anyone, I had the same problem, few of us spent 2 days on. On 3 servers everything worked ok and allso on development but on this server 404 non stop. The solution, I changed poold from integrated to classic and that worked

    0 讨论(0)
  • 2020-12-31 09:13

    In my case, I was transferring project from .NET 2.0 using automatic conversion. Converter added the <system.webServer> section and all the handlers and modules that are in the <system.web>. However, for each handler it added the following attribute: preCondition="integratedMode,runtimeVersionv2.0" Once I removed the attribute the 404s stopped and handler started to work.

    0 讨论(0)
  • 2020-12-31 09:13

    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.

    0 讨论(0)
  • 2020-12-31 09:18

    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.
    0 讨论(0)
提交回复
热议问题