问题
In our asp mvc application, we are using embedded views, images and css files. On deploying on IIS6, the views are being rendered but we are having problem with the images and css files. We are getting 404 not found error.
The same application on UltiDev Cassini Web Server is working fine. The problem seems to be with IIS6. Any kind of advice / help on this topic will be greatly appreciated.
回答1:
Are you telling IIS to handle all requests via the ISAPI filter? It wasnt clear if this had been done in your configuration. If not, this is needed on an MVC application in IIS6...
- Go into IIS manager.
- Select your website then properties.
- Home Directory
- Configuration
Then Insert a wildcard application map.
Set it to [star].[star] and set the executable to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
UNTICK "verify file exists".
That will make IIS6 push all requests for any file type through the ISAPI filter. The downside is performance but there are posts on SO to tell you how to write a better handler for your MVC application.
来源:https://stackoverflow.com/questions/2184990/asp-mvc-on-iis6