Why does MSMQ think I'm on a workgroup computer?

前端 未结 8 1461
孤独总比滥情好
孤独总比滥情好 2020-12-15 05:42

My computer is connected to a domain, but when I go to create a public queue:

MessageQueue.Create(@\".\\testqueue\");

I get this error:

相关标签:
8条回答
  • 2020-12-15 06:00

    I got the same problem and solved it by changing it to @".\private$\QueueName"

    0 讨论(0)
  • 2020-12-15 06:03

    It is possible that MSMQ installed in your machine as a guest user or another user so remove it from machine and install it with administrative permission.

    0 讨论(0)
  • 2020-12-15 06:06

    i got this error while debugging a web site from visual studio (2015). restarting the iisexpress solved this...

    0 讨论(0)
  • 2020-12-15 06:13

    I was facing the same problem, take a look at solution below. I don't know the reason but creating queue in this manner works perfectly.

    private MessageQueue messageQueue;
    public const string DEFAULT_QUEUE_NAME = "newQueue";
    public const string QUEUENAME_PREFIX = ".\\Private$\\";
    
    public static string QueueName
    {
        get
        {
            string result = string.Format("{0}{1}", QUEUENAME_PREFIX, DEFAULT_QUEUE_NAME);
            return result;
        }
    }
    
    public void SendMessage()
    {
        string queuePath = QueueName;
        MessageQueue  messageQueue = MessageQueue.Create(queuePath);
        messageQueue.Send("msg");            
    }
    

    you can create queue for receiving message in the same manner.

    0 讨论(0)
  • 2020-12-15 06:16

    Being part of a domain is a pre-cursor for installing MSMQ in AD-integrated mode. It doesn't guarantee MSMQ IS installed in AD-integrated mode. MSMQ will install in workgroup mode if:

    1. AD integration was not selected as a setup option
    2. AD integration was selected but failed to initialise; check event logs

    Yes, the workgroup name is confusing in a domain member situation.

    0 讨论(0)
  • 2020-12-15 06:16

    I know this is late, and there is already an accepted answer, but I just had this issue and it was resolved by changing the format of the queue string.

    When my queue name was this, I got the workgroup error:

    ".\QueueName"
    

    When I changed it to a more formal version, there was no error and sending to the queue worked:

    "FormatName:DIRECT=OS:ComputerName\private$\QueueName"
    

    Just in case someone else comes across this post, now they have something else to try...

    0 讨论(0)
提交回复
热议问题