I am trying to host a WCF service over net.msmq.
The following code gives me “The communication object, System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state.” Why is this? It works for net.tcp and http, so I assumed it should work for msmq, too.
I have already created a private message queue named “HelloIndigo”.
using (ServiceHost host = new ServiceHost(typeof(HelloIndigoService),
new Uri("net.msmq://localhost/private/HelloIndigo")))
{
host.AddServiceEndpoint(typeof(IHelloIndigoService),
new NetMsmqBinding(), "HelloIndigoService");
host.Open();
Console.WriteLine("Press <Enter> to terminiate the service host.");
Console.ReadLine();
}
Try enabling tracing, this should give you some exception info.
http://msdn.microsoft.com/en-us/library/ms733025.aspx