2011-09-16 40 views
0

我在服务器应用程序中收到以下异常。这个问题的原因是什么,我该如何调试这个问题。我正在从线程控制流异常

ICC_SequenceService_SequenceReportService.NotifyEventRecived]-Exception Occured :The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it has been Aborted.- 
Server stack trace: 

    at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen() 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 
+1

可能重复的[通信对象不能用于通信,因为它已被中止](http://stackoverflow.com/questions/1722857/the-communication-object-cannot-be-used-for-communication-因为它一直以来) – stuartd

+1

参见http://www.danrigsby.com/blog/index.php/2008/02/26/dont-wrap-wcf-service-hosts-or-clients-in -a-使用语句/ – stuartd

回答

1

这可能是因为当它失败你的客户不中止通道,并尝试,而不是关闭它的不同点除外。如果您使用由wsdl.exe和using语句生成的客户端代理,那么很不幸,这是默认行为。