2011-09-16 83 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語句生成的客戶端代理,那麼很不幸,這是默認行爲。