New IE App Compat VHDs ignoring CSS

Jun 10, 2011 13:33

For the benefit of my future self, and anyone trying to Google this crazy issue...

I've been using Microsoft's Internet Explorer App Compatibility VHD images in Virtual PC for a few years. The last two releases appear to have been done using a different setup, with less developer tools installed by default.

Apart from the different setup, one thing which changed for me was that my test environment no longer worked properly. My environment is made up of a remote server which renders some content, then loads the CSS/JS I'm working on from a server on my local box (addressed using a fully qualified hostname, rather than localhost or IP address). Previously this had worked fine, but now the CSS was being ignored. I could see IE requesting it in my server logs, but no style rules were taking effect. Flicking the switch to load resources from the production resource server made IE work just fine.

It turns out that IE is fussy about MIME types, and due to a misconfiguration my local server wasn't serving files with a MIME type header, whereas the production resource server was. When I added the config entries to automatically set MIME types for known file extensions, everything started working correctly.

The strangest thing was that IE only seemed to do this when the rendered page was served from a different domain to the CSS. When I served the rendered page off my local server, linking to my local CSS without a MIME type, IE was fine with that. Mysterious...

howto, web design

Previous post Next post
Up