Asp.net-mvc – Why is the IIS 7 refusing to serve up css or js when I change ‘Enable 32-Bit Applications’ to False

application-poolasp.netasp.net-mvciisiis-7

I have a very simple web application (asp.net MVC3, .net 4, using IIS not Visual Studio's embedded server, 64-bit Windows 7). When I change the settings in the application pool for my application and set 'Enable 32-Bit Applications' to False, my application's view shows up, but none of the static content (Content/Site.css or Scripts/myScript.js) shows up. Instead, I get status code 500 on those requests.

HTTP Error 500.0 – Internal Server Error
The page cannot be displayed because an internal server error has occurred.

The reason I'm changing this value is that I'm trying to use the 64-bit Oracle.DataAccess.dll and if I have this value set to True it causes the application pool to run in WOW64 mode and it tries to load the dll with the wrong format.

I've searched online for a while and can't find very much info about this. I've tried playing with permissions on the files, I've tried running aspnet_regiis with all kinds of flags. I'm out of ideas. Why won't IIS serve up this static content when running in 64bit mode?

Best Answer

When I had this error there was a problem in system.webServer\staticContent in web.config.

Because of a difference between servers, an for a particular MIME type was required on one machine but caused this error on another.

The failsafe would be to include a for each that you have in web.config to avoid getting a 500 if the is not required.