有这样的经验, 在本地的 IIS 上网站运行正常,但是发布到服务器上就一堆怪怪的问题 : MVC routing not work
http://stackoverflow.com/questions/12495346/asp-net-4-5-mvc-4-not-working-on-windows-server-2008-iis-7
http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html Owin not work
http://stackoverflow.com/questions/23276144/microsoft-owin-host-systemweb-and-still-getting-no-owin-environment-item-was-fou AuthorizeAttribute not work
http://stackoverflow.com/questions/21170269/asp-net-mvc5-application-throwing-nullreferenceexception-when-authorizing
http://stackoverflow.com/questions/11048863/modules-runallmanagedmodulesforallrequests-true-meaning Odata action 404
等等, 这么多怪怪的问题,都可以用 runAllManagedModulesForAllRequests=”true“ 来解决.