【发布时间】:2011-02-10 01:46:11
【问题描述】:
我最近将一个 ASP.Net 应用程序从 .Net 框架 3.5 升级到 4.0。该应用程序包含 WCF 服务,升级后返回 404 错误。
错误信息如下:
Server Error in '/' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /ws/ProviderService.svc
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
web.config 有
<error statusCode="404" redirect="Common/Pages/404b.htm"/>
它应该将 404 重定向到自定义页面。如果我尝试访问不存在的 .asmx 服务,那么它会正确重定向到 404b.htm 页面。
.Net 框架 4.0 似乎没有处理,但不知何故被 .Net 框架 2.0 拾取。
该站点位于 IIS7 和 Windows Server 2008 上。
有什么想法吗?
【问题讨论】: