Discussion:
Question about MSMQ in .NET and workgroup mode
(too old to reply)
MS
2005-11-18 20:29:57 UTC
Permalink
I had written a tool in VB6 to send messages to an external machine. It
works fine from my desktop which has MSMQ installed as an independent
client.

I'm rewriting this tool in C# and get the error that a workgroup
installation computer does not support the operation.

In VB6 I had a reference to Microsoft Message Queue 2.0 and in C# I'm just
using System.Messaging. Is there anyway I can send messages to a remote
computer when the local computers has MSMQ installed as an independent
client?
Frank Boyne
2005-11-18 23:59:49 UTC
Permalink
Post by MS
I'm rewriting this tool in C# and get the error that a workgroup
installation computer does not support the operation.
It's hard to guess what is going on without knowing what operation you are
attempting. Any chance you could post the problem fragment of C# and the
piece of VB6 it is a translation of?

One possibility is a pathname/format name confusion. The
System.Messaging.MessageQueue constructor assumes that the string passed in
is a path name unless it starts with "Formatname:". But pathnames for
remote systems are not supported in Workgroup mode so a misconstructed
string passed to the constructor might result in the "computer does not
support operation" error.

The following VB6 fragment...

Dim qi As New MSMQQueueInfo
qi.FormatName = "DIRECT=OS:HOST.EXAMPLE.COM\PRIVATE$\demo5"

would be translated into C# as...

MessageQueue q = new MessageQueue
(@"FORMATNAME:DIRECT=OS:HOST.EXAMPLE.COM\PRIVATE$\demo5")

The ampersand preceding the string constant is there to ensure that the
back-slash is treated literally and not as part of an escape sequence like
\n for newline.
MS
2005-11-19 03:36:05 UTC
Permalink
Thanks Frank. Your example helped me. I didn't have "FORMATNAME:" in the
beginning. I just started out with "DIRECT".
Post by Frank Boyne
Post by MS
I'm rewriting this tool in C# and get the error that a workgroup
installation computer does not support the operation.
It's hard to guess what is going on without knowing what operation you are
attempting. Any chance you could post the problem fragment of C# and the
piece of VB6 it is a translation of?
One possibility is a pathname/format name confusion. The
System.Messaging.MessageQueue constructor assumes that the string passed
in is a path name unless it starts with "Formatname:". But pathnames for
remote systems are not supported in Workgroup mode so a misconstructed
string passed to the constructor might result in the "computer does not
support operation" error.
The following VB6 fragment...
Dim qi As New MSMQQueueInfo
qi.FormatName = "DIRECT=OS:HOST.EXAMPLE.COM\PRIVATE$\demo5"
would be translated into C# as...
MessageQueue q = new MessageQueue
The ampersand preceding the string constant is there to ensure that the
back-slash is treated literally and not as part of an escape sequence like
\n for newline.
Loading...