WCF分布式开发常见错误解决(12):The server was unable to process the request,服务无法处理请求

本文详细介绍了在进行WCF编程过程中遇到服务无法处理请求由于内部错误时的解决方法,包括如何在服务行为里配置错误属性以发送详细错误信息回客户端。同时提供了多个常见错误及其解决方案的系列文章链接,帮助开发者快速定位和解决WCF分布式开发中的常见问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


http://tech.ddvip.com/2009-06/1245068403123972.html



进行WCF编程过程中会遇到这样的错误:服务无法处理的请求由于内部错误。   

  具体信息如下:

  The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

  错误截图:

   由于内部错误,无法处理请求。

  解决办法:

  在服务行为里配置错误属性即可:

  添加如下代码到服务类:

双击代码全选
1
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]

  系列文章:

  WCF分布式开发常见错误解决(1):An error occurred while attempting to find services at...添加服务引用出错

  WCF分布式开发常见错误解决(2)无法从传输连接中读取数据: 远程主机强迫关闭了一个现有的连接

  WCF分布式开发常见错误解决(3):客户端调用服务出错

  WCF分布式开发常见错误解决(4):The type or namespace name 'DataContract' could not be found DataContract找不到

  WCF分布式开发常见错误解决(5)Could not find a base address that matches scheme

  WCF分布式开发常见错误解决(6)Service 'WcfServiceApp.WCFService' has zero application

  WCF分布式开发常见错误解决(7):System.InvalidOperationException,Cannot have two operations in the same contract

  WCF分布式开发常见错误解决(8):不一致的访问性Inconsistent accessibility

  WCF分布式开发常见错误解决(9):无终结点监听,There was no endpoint listening at

  WCF分布式开发常见错误解决(10):套接字连接中断,The socket connection was aborted

  WCF分布式开发常见错误解决(11):There is already a listener on IP endpoint ,IP 终结点 已经存在侦听器

  WCF分布式开发常见错误(13):The transaction under which this method call was executing ,此方法调用的事务被异步中断

  WCF分布式开发常见错误(14):无效的操作异常,At least one operation on the ...

  WCF分布式开发常见错误(15):Communication with the underlying transaction manager has failed

  WCF分布式开发常见错误(16):The Transaction has aborted,事务已经被中断

  WCF分布式开发常见错误(17):无法启动MSMQ服务


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值