【问题标题】:Troubleshooting 404 WCF Service error404 WCF 服务错误疑难解答
【发布时间】: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 上。

有什么想法吗?

【问题讨论】:

    标签: wcf iis-7


    【解决方案1】:

    即使是.Net 4.0,我相信asp.net说的是Net framework 2.0,web.config中customerror标签的设置是什么

    确保将其设置为“关闭”而不是“仅远程”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-29
      • 1970-01-01
      • 2013-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多