500.19 – Internal Server Error – The requested page cannot be accessed because the related configuration data for the page is invalid

Today I faced this error while trying to run a web application.

It turned out that it was occurred in a REST request to the server to retrieve a JSON file. I tried to solve this issue by first opening IIS and check the declared MIME types under the web application, then it complained that there is a duplicate entry in the web.config file.

It turned out that if the web.config file contains a declaration for the MIME type .json and under the application in IIS the MIME type is also declared, IIS will complain. I solved the issue by removing the MIME type declaration from the web.config file.

Leave a Reply

Your email address will not be published. Required fields are marked *