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

SunnySharma-4215 0 Reputation points
2023-04-18T15:29:10.31+00:00

i have wcf service hosted in app service in azure created a client and test it works fine for me . now Scenerio is when i try to scale up the instance count to 2 in azure and restart and retest it i got this error "The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state." now when i switch back to 1 instance and restart and retest again work fine so my problem is i have heavy loads to process for that i want to scale this wcf to 2 but when i do that i got this error on clinet side expection User's image

this error occurs when i scale my application from one instance to two instances. it works fine when i have only one instance. I'm using TransportwithMessageCredentials as mode of Secuirty..

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,975 questions
Developer technologies | .NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2023-04-25T03:42:04.4466667+00:00

    Bear in mind there wasn't enough information provided to complete help resolve your issue. However, based on what you've provided, there could be several reasons why your WCF service wound up in a faulted state when scaling up to multiple instances. Remember, when scaling out your WCF service has to be configured to run simultaneously.

    One possible cause is your service isn't initially designed to run to on multiple instances. This exposes your service to conflicts between instances, race conditions, and other synchronization issues. To resolve, look at implementing synchronization mechanisms such as a distributed cache and/or ensuring it's completely stateless.

    Another possible reason could be a configuration issue. This could be using a binding that is not compatible or better suited with multiple instances. Bindings that are better suited are NetTcpBinding, NetHttpBinding, WSHttpBinding, and BasicHttpBinding.

    There may also be an inner exception that was logged that led up to the faulted state; feel free to share any log snippets should the above suggestions not be helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.