Ranjita Das
Ranjita Das

Reputation: 443

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state

Game

error occur: "The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state."

that error occured due to app.config?

have any idea? Thanks

Upvotes: 2

Views: 8108

Answers (3)

user4783404
user4783404

Reputation:

what can be the reason is that u use a service to get data from another program or whatever. for example if u use a technicService version 1.2 ( see web.config) and and for example a billingService version 1.3( see web.config) now it can happen that your billing service corresponds with technicService 1.3 instead of 1.2 then you olso get this error

Upvotes: 0

silentsanta
silentsanta

Reputation: 11

I was receiving this error, event though no first-chance exception was appearing on the server, and in my case it was because the response I was receiving included 200k of bytes (a pdf); and I hadn't set up the appropriate settings in my config file to allow large sizes, and appropriate timeouts:

<netTcpBinding>
    <binding name="NetTcpBinding_IExampleService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647">
        <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
    </binding>
</netTcpBinding>

It would have been nice if the error messages had been more specific.

Obviously, my 2 gigabyte limit is not necessarily appropriate in your situation I would encourage readers to choose a value that is appropriate for your specific use case.

Upvotes: 1

Pablote
Pablote

Reputation: 5083

That usually happens when you get an unhandled exception either in the server or the client. That client you have is not good anymore and you need to create a new one.

In case the error happened on the server side, you should be using fault exceptions (they don't fault the channel). You can also subscribe to this event to know exactly when it happened.

Upvotes: 0

Related Questions