I recently ran across this common error when migrating an IIS7.5 web site to IIS8.5.
This error occurred regardless of what I was trying to access; the server responded with it for all requests. For this particular site I had exported the site and app pool configuration from the old server and imported it into the new server using appcmd. Everything seemed to be fine with the application cofigurations.
It didn’t matter if it was static content or a request to an application. Also, I had detailed error messages enabled to see what the problem was but nothing I tried returned a detailed error, only this generic error. It seems to me now that a site level configuration error will prohibit detailed error messages from being returned to the client. I got lucky when trying to look at different configuration elements from within IIS manager. I got lucky when clicking on one of the configuration items. I happened to try and open the MIME Types element on the site level and received an error message stating that there was a duplicate MIME type for MP4 files:
IIS7.5 does not include a mapping for MP4 out of the box so on the old server I had to add it manually:
IIS8.5 now includes this type, which is a good thing since it’s obviously a popular format. I opened the web.config file of the site on the IIS8.5 server and saw the mapping:
I then removed the entire <staticContent> section that is highlighted and the site started behaving properly. My site has a fairly simple configuration so if you have more than just the one MIME type in your <staticContent> section then you obviously don’t want to remove the whole section, but rather just the duplicate mapping.
No Comments Yet