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

17,841

Solution 1

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

Solution 2

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.

Solution 3

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.

Solution 4

Having to put comment here as I dont have enough points to comment.

Have you tried checking the handler mapping on your website.

Under Handler Mappings: Check that the StaticFile Handler is still registered and that the path is assigned to *

Also check that it is enabled.

Share:
17,841

Related videos on Youtube

Gerfboy
Author by

Gerfboy

Updated on June 04, 2022

Comments

  • Gerfboy
    Gerfboy about 2 years

    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?

  • Gerfboy
    Gerfboy over 12 years
    My StaticFileHandler is still registered, and enabled, and assigned to *. No dice here.
  • Base33
    Base33 over 10 years
    This answer worked for me. In IIS 8, it has .woff and .mp4 by default, and my web.config was trying to declare the mime types too. I removed the static content mime type from the web.config and started working.
  • Shahab
    Shahab almost 9 years
    I had same problem, because duplicated definitions for mp4 in web.config and machine.config!!! Thanks!
  • user752746
    user752746 over 8 years
    Thank you, this answer save me a lot of time!