MSMQ woes

B

Brad Quinn

Why, when I call MessageQueue.GetPublicQueuesByMachine from
a WebApplication, do I get the following exception?

When I excecute the same code in a "WindowsApplication" I
get the expected result.

1) Exception Information
*********************************************
Exception Type: System.Messaging.MessageQueueException
MessageQueueErrorCode: -1072824176
Message: NULL
ErrorCode: -2147467259
TargetSite: System.Guid GetMachineId(System.String)
HelpLink: NULL
Source: System.Messaging

StackTrace Information
*********************************************
at System.Messaging.MessageQueue.GetMachineId(String
machineName)
at
System.Messaging.MessageQueueCriteria.set_MachineName(String
value)
at
System.Messaging.MessageQueue.GetPublicQueuesByMachine(String
machineName)
at WebQueueManager.WebForm1.btnLookup_Click(Object
sender, EventArgs e) in
c:\inetpub\wwwroot\webqueuemanager\webform1.aspx.cs:line 65

The simplest code that misbehaves in my WebApplication is
MessageQueue.Exists( queuePath ), but that doen't provide
any additional information.

I'm pretty sure I've solved this problem before with
version 1.0 of the framework, when I recall changing
permissions on the queue. This doesn't seem to be the same
problem though.

Thanks,
Brad
 
B

Brad Quinn

I've found an acceptable way around my problem.

I'm using the this path
"FormatName:DIRECT=OS:.\\LogManager" instead of
".\\LogManager".

It seems that my WebApplication doesn't have permission to
"see" message queues via Active Directory (or whatever
mechanism is used).

It seems that MessageQueue.Exists doesn't work with this
path format. So I either need to send a test message to
the queue or peek at it to know if it exists. I don't
particularly want to give my web application peek
permission, so I guess I'll modify my queue consumer to
ignore the test message.
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top