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