Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my IIS 7 refusing to serve up css or js when I change 'Enable 32-Bit Applications' to False

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?

like image 680
Gerfboy Avatar asked Feb 07 '12 00:02

Gerfboy


3 Answers

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.

like image 108
James Green Avatar answered Oct 21 '22 01:10

James Green


It is very likely that on your IIS setup, a 32 bit only module is installed by you accidentally which prevents the whole web application from running in 64 bit module. That's a common cause of such 500 errors.

Failed request tracing should be able to show you more information on which module it is,

http://www.iis.net/learn/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis

like image 4
Lex Li Avatar answered Oct 21 '22 01:10

Lex Li


Double check mime types are correctly assigned, it could be because you have double entry of mimetypes for local site web.config and server itself.

like image 3
Sergey Kravchenko Avatar answered Oct 21 '22 01:10

Sergey Kravchenko