0

我正在尝试在我的 asp.net (wcf) Web 服务项目中实现发布者 - 订阅。当我试图在 global.asax 中创建总线时

 protected void Application_Start(object sender, EventArgs e)
    {
        try
        {
            log4net.Config.XmlConfigurator.Configure();                
            Bus = NServiceBus.Configure.WithWeb()
          .SpringBuilder()
          .BinarySerializer()
          .MsmqTransport()              
              .IsTransactional(false)
              .PurgeOnStartup(false)
          .UnicastBus()
              .ImpersonateSender(false)
          .CreateBus()
          .Start();                
        }
        catch (Exception ex)
        {
            log.Error(ex);
        }
    }
  public static IBus Bus { get; private set; }

但它没有创建总线..然后它抛出异常

    Exception reached top level.
System.Messaging.MessageQueueException: Access to Message Queuing system is denied.
   at System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle()
   at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int32 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback receiveCallback, CursorHandle cursorHandle, IntPtr transaction)
   at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
   at System.Messaging.MessageQueue.Peek(TimeSpan timeout)
   at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.Receive()
   at NServiceBus.Utils.WorkerThread.Loop()

我怎样才能避免这种情况?............我被击中了......


nRk

4

1 回答 1

2

这很可能是一个安全问题,请确保让每个人都拥有参与队列的全部权利

希望这可以帮助!

于 2009-12-08T19:30:45.357 回答