22

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?

Mike Pateras
  • 14,715
  • 30
  • 97
  • 137

8 Answers8

30

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

Bob Horn
  • 33,387
  • 34
  • 113
  • 219
  • 18
    ".\QueueName" points to a public queue. Sending messages to a public queue throws the above mentioned error. But sending messages to a private queue does not. Your formal version is actually pointing to a private queue. That's the reason they work. – Siddharth Jul 31 '12 at 07:38
16

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

arjun
  • 625
  • 10
  • 27
15

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.

Pshemo
  • 122,468
  • 25
  • 185
  • 269
John Breakwell
  • 4,667
  • 20
  • 25
  • 5
    I checked the logs and found that MSMQ was detecting a previous MSMQ configuration conflicted with it working with AD. I had installed MSMQ, and later enabled the AD integration. I completely uninstalled MSMQ, and then reinstalled it with everything (AD integration included), and I stopped getting the error. Thank you for your help. – Mike Pateras May 10 '11 at 16:10
  • 1
    Your comment describes the answer that worked for me: not only did I have to add the extra MSMQ components, I had to *uninstall* MSMQ completely first to get it to work properly. – Paul Suart Sep 12 '11 at 05:34
  • Can someone please elaborate on where to find the "event logs" (I have tried to find something about MSMQ in eventvwr.msc, but Microsoft/Windows/MSMQ/End2End is empty) and how to "delete the MSMQ object in AD"? – Alexander Jul 06 '18 at 11:00
  • Deleting Stale MSMQ Active Directory Objects https://blogs.msdn.microsoft.com/johnbreakwell/2009/12/16/deleting-stale-msmq-active-directory-objects/ – John Breakwell Jul 09 '18 at 12:09
  • Similar to @MikePateras, I didn't have "MSMQ Active Directory Domain Services Integration" installed, but I didn't have to uninstall MSMQ. I only needed to install AD integration and restart both the Message Queuing service and the app that was trying to access the queue. (Presumably it would be best to stop the MSMQ service, install AD integration, and start the service.) – csrowell Apr 17 '19 at 20:54
3

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.

Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
user913359
  • 660
  • 7
  • 14
1

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();
}
Shashank
  • 544
  • 6
  • 6
0

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.

MSMQ configuration

0

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.

Powershell - reinstalling MSMQ

Tore Aurstad
  • 3,189
  • 1
  • 27
  • 22
0

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

Elad
  • 1,523
  • 13
  • 10