问题
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?
回答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
回答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.
回答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.
回答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.
回答5:
Just had this issue myself with windows security enabled and ananamous access turned off.
The solution in my case was to add the localhost site to my local intranet sites. Running Visual Studio in adminstrator mode can also clear the problem.
来源:https://stackoverflow.com/questions/9169430/why-is-my-iis-7-refusing-to-serve-up-css-or-js-when-i-change-enable-32-bit-appl