有一个关于在开发环境上一切都能正常工作,但在主机服务器上不能正常工作的老故事。
HTTP错误404.0 - 未找到
- Module IIS Web Core
- Notification MapRequestHandler
- Handler StaticFile
- Error Code 0x80070002
尝试通过添加<remove name="UrlRoutingModule-4.0" />
到system.webServer - modules并在添加<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
时解决在开发机器上产生相同的错误,但在主机上却没有起到作用。我还尝试过<modules runAllManagedModulesForAllRequests="true" />
,但仍然没有改变。
这是handlers部分的内容:
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<remove name="WebDAV" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
补充更多信息:
- MVC.Net 5.2.2.0
- 运行在Windows 2008上的IIS 7.5
- 使用集成.NET 4.0应用程序池。
我还需要做什么吗?
现在,在 IIS8 中遇到同样的问题,有什么想法吗?