My ASP.NET MVC 5 app can't find json files. I'm getting a 404 error when I look for a json file, but if I look for a png file in the same directory it finds that. In web.config I have:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
Is there anything else I need to do in Visual Studio to find json files?
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json; charset=UTF-8" />
</staticContent>
</system.webServer>
See adding .json handler support in IIS.
Also, ensure the request is not going into the routing framework by putting a breakpoint. (since PNG is served, this is probably not an issue)
You need to go into IIS and add a mimetype for it as well as adding it into your web.config file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With