Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Public Queue With ASP.NET Problem

3 views
Skip to first unread message

Mohammad Abd Elrahman

unread,
Oct 22, 2008, 3:14:01 AM10/22/08
to
Hello,
I am using message queues in C# asp.net 3.5. I create a public message
queue and on subsequent execution of the code, I check if the queue exists.
If it does, I don't want to create it again. The queue gets created
successfully, but the problem is MessageQueue.Exists method or
GetPublicQueuesByMachine method can't find this queue once it is created, so
the control goes to the 'create' statement again and it fails by giving this
error:

System.Messaging.MessageQueueException: Queue with the specified path name
is already registered in the DS.

The GetPublicQueuesByMachine method does't find this queue and gives the
Unhandled Execution Error and MessageQueueException with message text as
NULL.

But GetPrivateQueuesByMachine method works fine and retrieves all private
queues. Another thing is, if the same code is run in a Windows Application,
it works fine and retrieves the public queue.
So why does it not find the PUBLIC queue in a WEB application?
and if i switched the code to manage PRIVATE Queue no problems found....!!
here is my code. Please help.

if (!MessageQueue.Exists(".\\requestq")) //???
{
MessageQueue requestq = MessageQueue.Create(".\\requestq");
}

MessageQueue[] mqlist = null;
try
{
mqlist = MessageQueue.GetPublicQueuesByMachine("."); //???
}
catch (MessageQueueException ex)
{
string mesg = ex.Message;
}
--
Sakhrawy

Frank Boyne

unread,
Oct 22, 2008, 6:50:24 PM10/22/08
to
It doesn't really make sense to post questions into mre than one of the
msmq.* newsgroups. People who read one group usually read all of them.
Also, posting in multiple groups can cause the discussion to fragment.

If you feel you must post to multiple groups it is helpful if you
cross-post one message to multiple groups rather than posting a message
to a group and then a second message to a second group and so on. If
you cross-post at least the newsgroup reading software can recognise the
message is posted in multiple groups and can mark them as read in all
groups at once.


0 new messages