我正在考虑将其发布到哪个部分,但我想我来对了地方。如果我错了,请先道歉!
我有一个 Windows Server 2008,托管一个小型 ASP.NET Web 应用程序 (IIS7) 已经快一年了。在这一年中,我注意到在看似随机的页面上,我自己和其他人会随机收到 404 Forbidden / Access is denied 错误。
每次,解决方案都是在托管 ASP.NET Web 应用程序的 Windows Server 2008 机器上运行 Windows 更新。
在类似的问题上,我看到建议runAllManagedModulesForAllRequests="true"
在 web.config 中设置将解决 404 问题。
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
<handlers>
<remove name="UrlRoutingHandler"/>
</handlers>
</system.webServer>
我的 Windows Server 2008 上的 Windows 更新导致我的 ASP.NET Web 应用程序出现此 404 问题的原因是什么?另外,这段代码能解决我的问题吗?当然很多人会说要测试一下,但错误很少见,可能需要一周、一个月/几个月的时间才会出现。