我收到以下异常,但不知道到底出了什么问题。
System.ServiceModel.CommunicationObjectFaultedException: '通信对象 System.ServiceModel.Channels.ServiceChannel 不能用于通信,因为它处于故障状态。
我知道这是由于在业务端反序列化 DataContract 所致。DataContract 等价于线路的两侧(客户端和业务)。
由于域的复杂性,很难在此处添加参考,但到目前为止,我一直在通过从线路客户端[DataMember]
的属性中删除来隔离和解决这些问题。[DataContract]
我可以继续以这种方式解决,但这对我来说是一项乏味的工作并且需要相当长的时间,所以我很想知道 WCF 是否可以通过在客户端返回的异常中提供详细信息来确定问题本身。
我的服务 app.config
<system.serviceModel>
<services>
<service name="FSX.Business.Managers.ExecutionManager"
behaviorConfiguration="Debugging">
<endpoint address="net.tcp://localhost:8009/ExecutionService"
binding="netTcpBinding"
contract="FSX.Business.Contracts.IExecutionService" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding maxReceivedMessageSize="2000000" transactionFlow="true">
<reliableSession enabled="true"/>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Debugging">
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
我已经阅读了很多帖子,包括下面提到的一些帖子,但仍然无法解决。虽然我已经添加了IErrorHandler
.