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

老子叫甜甜 提交于 2019-11-27 17:23:06

问题


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

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

I get this error:

A workgroup installation computer does not support the operation.

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


回答1:


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.




回答2:


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...




回答3:


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




回答4:


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.




回答5:


Adding for documentation purpose... I was getting error "A workgroup installation computer does not support the operation" while trying to access transactional dead letter queue and it was due to not specifying the machine name. I was using period to denote computer name. e.g. "FORMATNAME:DIRECT=OS:.\SYSTEM$;DEADXACT". It does not work even with using complete format name. Problem solved after replacing the period with computer name. Below is the working code.

using (var queue = new MessageQueue($@"FORMATNAME:DIRECT=OS:{Environment.MachineName}\SYSTEM$;DEADXACT"))
{
    queue.Purge();
}



回答6:


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.




回答7:


On the server I was having trouble running MSMQ and getting different kinds of errors, including the error asked in the question.

A workgroup installation computer does not support the operation

What worked for me was not fiddling with Server Manager, but reinstalling MSMQ using Powershell.

Remove-WindowsFeature Msmq; Add-WindowsFeature MsMq

These two cmdlets can be run in a Powershell console running as Administrator. At least it fixed the error for me, but this will install the entire Msmq feature, including subfeatures.



来源:https://stackoverflow.com/questions/5951677/why-does-msmq-think-im-on-a-workgroup-computer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!