Connecting Tech Pros Worldwide Forums | Help | Site Map

MSMQ workgroup and C#

MSMQ workgroup and C#
Guest
 
Posts: n/a
#1: Nov 16 '05
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.Mess aging.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



Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#2: Nov 16 '05

re: MSMQ workgroup and C#


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]
- mvp@spam.guard.caspershouse.com

"MSMQ workgroup and C#" <MSMQ workgroup and C#@discussions.microsoft.com>
wrote in message news:B30DC816-2874-4EF4-9E09-524325C57459@microsoft.com...[color=blue]
> 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.Mess aging.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
>
>[/color]


Willy Denoyette [MVP]
Guest
 
Posts: n/a
#3: Nov 16 '05

re: MSMQ workgroup and C#


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#" <MSMQ workgroup and C#@discussions.microsoft.com>
wrote in message news:B30DC816-2874-4EF4-9E09-524325C57459@microsoft.com...[color=blue]
> 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.Mess aging.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
>
>[/color]


Moti
Guest
 
Posts: n/a
#4: Nov 16 '05

re: MSMQ workgroup and C#


Hi Willy

This was the problem!
You save me….

Thank you truly for your help.

Moti


"Willy Denoyette [MVP]" wrote:
[color=blue]
> 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#" <MSMQ workgroup and C#@discussions.microsoft.com>
> wrote in message news:B30DC816-2874-4EF4-9E09-524325C57459@microsoft.com...[color=green]
> > 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.Mess aging.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
> >
> >[/color]
>
>
>[/color]
Moti
Guest
 
Posts: n/a
#5: Nov 16 '05

re: MSMQ workgroup and C#


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 [.NET/C# MVP]" wrote:
[color=blue]
> 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]
> - mvp@spam.guard.caspershouse.com
>
> "MSMQ workgroup and C#" <MSMQ workgroup and C#@discussions.microsoft.com>
> wrote in message news:B30DC816-2874-4EF4-9E09-524325C57459@microsoft.com...[color=green]
> > 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.Mess aging.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
> >
> >[/color]
>
>
>[/color]
Closed Thread