I have been getting the "ERROR 404.3 Not Found" for JSON file that I am calling using AJAX call on "Internet Information Services 7.5" even after I have activated all the "Application Development Features". Other than JSON file, all other files are getting loaded.
I am running an HTML page on IIS server on my local machine.
If I open the file directly then there is no problem at all. When I host the files on an online server it works fine.
Any quick help will be much appreciated.
As said by @elasticman, it is necessary to open IIS Manager -> Mime types -> Add a new mime type with
Extension: .json MIME Type: application/json
But for me that still wasn't enough. I have an ASP.NET MVC 4 application, and I had to modify my root Web.config file.
Insert
somewhere inside your
I've applied the following settings on the IIS was right.
1.Open IIS Manager
2.Display properties for the IIS Server
3.Click MIME Types and then add the JSON extension:
File name extension: .json
MIME type: application/json
4.Go back to the properties for IIS Server
5.Click on Handler Mappings
Add a script map
Request path: *.json
Executable: C:\WINDOWS\system32\inetsrv\asp.dll Name: JSON
Is the file you try to receive in the same domain? Or do you fetch the json from another server? If it is hosted on a different domain, you'll have to use JSONP due to same origin policy.
As suggested by @ancajic i put the below code after connectionString tag in my web.config file and it worked.
To solve this problem with an Azure App Service:
Use FTP or the Kudu dashboard to add this file one level above wwwroot--
/site/applicationHost.xdt:
Then, under Application settings in the Azure Portal, add a Handler mapping:
I haven't the same problem but for me (Windows Server 2003 IIS 6) the MIME type application/json not work. I use text/plain and work perfect (You not need restart the server)