故障排除404 WCF服务错误

时间:2011-02-10 01:46:11

标签: wcf iis-7

我最近将.Net framework 3.5的ASP.Net应用程序升级到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 framework 2.0接收。

该网站位于IIS7和Windows Server 2008上。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

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

确保将其设置为“关”而不是“RemoteOnly”