【问题标题】:Why can the net.msmq binding in WCF not be used in this way?为什么WCF中的net.msmq绑定不能这样使用?
【发布时间】:2012-03-15 13:40:17
【问题描述】:

我正在尝试通过 net.msmq 托管 WCF 服务。

下面的代码给了我“通信对象 System.ServiceModel.ServiceHost,不能用于通信,因为它处于故障状态。”这是为什么?它适用于 net.tcp 和 http,所以我假设它也适用于 msmq。

我已经创建了一个名为“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();
}

【问题讨论】:

    标签: wcf msmq


    【解决方案1】:

    尝试启用跟踪,这应该会为您提供一些异常信息。

    http://msdn.microsoft.com/en-us/library/ms733025.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-24
      • 2013-07-18
      • 2011-03-21
      • 2021-04-20
      • 1970-01-01
      相关资源
      最近更新 更多