MSMQ workgroup and C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My MSMQ is in workgroup installation.

I tried to add an event handler for the ReceiveCompleted event and to do
It I try to use the SetPermissions. but I get an error of

“A workgroup installation computer dose not support the operationâ€

The code is:

MessageQueue myQueue = new MessageQueue(".\\myQueue");
System.Messaging.Trustee trustee = new Trustee(@".\\myQueue");
MessageQueueAccessControlEntry ace = new
MessageQueueAccessControlEntry(trustee,System.Messaging.MessageQueueAccessRights.FullControl);

myQueue.SetPermissions(ace); // Error here!!!

myQueue.Formatter = new XmlMessageFormatter(new type[]{typeof(String)});

// Add an event handler for the ReceiveCompleted event.
myQueue.ReceiveCompleted += new
ReceiveCompletedEventHandler(MyReceiveCompleted); // Error here too!!!

// Begin the asynchronous receive operation.
myQueue.BeginReceive();

Does anyone know how to pass this problem?

Moti Saba
 
Moti,

It could be that is an incorrect message. Do you have the rights to
change the access permissions on the queue? Also, what version of MSMQ are
you running (please don't say the one from option pack 4)?
 
You have to use direct format names in workgroup mode when writing/reading
from public queues.
Something like this will do:

string mqPath = @"FormatName:DIRECT=OS:.\myQueue";
myQueue = new MessageQueue();
myQueue .Path=mqPath;
....

Willy.
 
Hi Willy

This was the problem!
You save me….

Thank you truly for your help.

Moti


Willy Denoyette said:
You have to use direct format names in workgroup mode when writing/reading
from public queues.
Something like this will do:

string mqPath = @"FormatName:DIRECT=OS:.\myQueue";
myQueue = new MessageQueue();
myQueue .Path=mqPath;
....

Willy.



MSMQ workgroup and C# said:
My MSMQ is in workgroup installation.

I tried to add an event handler for the ReceiveCompleted event and to do
It I try to use the SetPermissions. but I get an error of

"A workgroup installation computer dose not support the operation"

The code is:

MessageQueue myQueue = new MessageQueue(".\\myQueue");
System.Messaging.Trustee trustee = new Trustee(@".\\myQueue");
MessageQueueAccessControlEntry ace = new
MessageQueueAccessControlEntry(trustee,System.Messaging.MessageQueueAccessRights.FullControl);

myQueue.SetPermissions(ace); // Error here!!!

myQueue.Formatter = new XmlMessageFormatter(new type[]{typeof(String)});

// Add an event handler for the ReceiveCompleted event.
myQueue.ReceiveCompleted += new
ReceiveCompletedEventHandler(MyReceiveCompleted); // Error here too!!!

// Begin the asynchronous receive operation.
myQueue.BeginReceive();

Does anyone know how to pass this problem?

Moti Saba
 
Hi Nicholas

I have the rights to change the access permissions on the queue and
I using win xp sp2.
This was my first idea.
I manage to operate the system. The problem was the direct format names
as Willy suggest.

Thank you for your help.

Moti


Nicholas Paldino said:
Moti,

It could be that is an incorrect message. Do you have the rights to
change the access permissions on the queue? Also, what version of MSMQ are
you running (please don't say the one from option pack 4)?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

MSMQ workgroup and C# said:
My MSMQ is in workgroup installation.

I tried to add an event handler for the ReceiveCompleted event and to do
It I try to use the SetPermissions. but I get an error of

"A workgroup installation computer dose not support the operation"

The code is:

MessageQueue myQueue = new MessageQueue(".\\myQueue");
System.Messaging.Trustee trustee = new Trustee(@".\\myQueue");
MessageQueueAccessControlEntry ace = new
MessageQueueAccessControlEntry(trustee,System.Messaging.MessageQueueAccessRights.FullControl);

myQueue.SetPermissions(ace); // Error here!!!

myQueue.Formatter = new XmlMessageFormatter(new type[]{typeof(String)});

// Add an event handler for the ReceiveCompleted event.
myQueue.ReceiveCompleted += new
ReceiveCompletedEventHandler(MyReceiveCompleted); // Error here too!!!

// Begin the asynchronous receive operation.
myQueue.BeginReceive();

Does anyone know how to pass this problem?

Moti Saba
 
Back
Top