I had an issue where .json files weren't being sent to clients when doing jQuery $.getJSON calls. It was returning a 404.3 IIS error message that told me to go to my IIS install directory and enter a command:
appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']
where .xyz
in my case was .json
and the mimeType was application/json
.
I then later found out that instead I can simply add a staticContent element in my web.config file which was necessary for my production hosting solution.
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
So I did that, but then IIS complained about duplicate handling for .json files, so I went back to my IIS installation dir and ran
appcmd clear config /section:staticContent
which in retrospect was missing an argument for which mimetype to remove.
So now when I try to load my page IIS is giving me the same 404.3 error message, only now it's complaining about the .html extension.
It seems to me that I deleted ALL the default mime types from IIS and now I don't know how to get them back. Can anyone help me?
EDIT Nov 5, 2015: I misspoke above. This is all IIS Express, not IIS