MSMQ workgroup and C#

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
 
N

Nicholas Paldino [.NET/C# MVP]

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)?
 
W

Willy Denoyette [MVP]

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

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top