1)在system.webServer下增長,這種是不推薦的。css
<modules runAllManagedModulesForAllRequests="true" />
2)添加modules節點,BundleModule是使用bundle方式加載css、js文件所須要的,不加會出現文件404。html
<modules> <remove name="UrlRoutingModule-4.0" /> <remove name="BundleModule" /> <add name="BundleModule" type="System.Web.Optimization.BundleModule" /> <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> </modules>
3)打補丁,若是是windows server 2008 R2版本,非sp1,打個補丁就能夠了。web
https://www.microsoft.com/zh-CN/download/details.aspx?id=5272windows
其餘版本的windows可根據系統版本下載對應的補丁。spa
https://support.microsoft.com/zh-cn/help/980368/a-update-is-available-that-enables-certain-iis-7-0-or-iis-7-5-handlerscode
參考地址:orm
http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.htmlserver
http://www.cnblogs.com/xishuai/archive/2015/01/06/Styles-Render-runAllManagedModulesForAllRequests-true.htmlhtm
https://bartwullems.blogspot.com/2012/06/optimize-performance-of-your-web.htmlblog
https://support.microsoft.com/zh-cn/help/980368/a-update-is-available-that-enables-certain-iis-7-0-or-iis-7-5-handlers
https://www.microsoft.com/zh-CN/download/details.aspx?id=5272