wcfmsmq

System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state


Receiving this error when trying to work with the queue:

Unexpected error occured: The communication object, System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state. at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)

How to overcome it?

Update: answer to my solution posted at the end


Solution

  • Update: In my case what helped was:

    1) enabling trace logs: http://msdn.microsoft.com/en-us/library/ms732023.aspx

    2) in the trace log it wrote this:

    Binding validation failed because the binding's ExactlyOnce property is set to true while the destination queue is non-transactional. The service host cannot be opened. Resolve this conflict by setting the ExactlyOnce property to false or creating a transactional queue for this binding.

    The answer says it all. Created a transactional queue - everything works :) hope it helps people :)