Why does StaticFileHandler not server .json?

iis-7.5, json

Solution

In my case a StaticFileHandler does handle json by itself. The asp.dll handler is not required.

Problem was a sneaky trailing space in the fileExtension property:

<mimeMap fileExtension=".json " mimeType="application/json" />

doh

Problem

We have a problem downloading .json files via IIS7.5. MIME type has been set correctly: ``` <mimeMap fileExtension=".json " mimeType="application/json" /> ``` But still gives error: "HTTP Error 404.3 - Not Found". To get it to work we have to add a handler mapping: ``` <handlers> <add name="JSON" path="*.json" verb="*" modules="IsapiModule" scriptProcessor="C:\WINDOWS\system32\inetsrv\asp.dll" resourceType="Unspecified" /> </handlers> ``` Why can't json files be handled by the StaticFileHandler like other static content? It seems bizarre we have to install classic asp support to handle json files.

Original source

Related problems