Answered by:
Public Queue With ASP.NET Problem

Question
-
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.MessageQueueExcepti on: 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.GetPublicQueuesByMachin e("."); //???
}
catch (MessageQueueException ex)
{
string mesg = ex.Message;
}
Muslim- Moved by _larsw Wednesday, October 22, 2008 11:21 AM Off-topic for the WCF forum (Moved from Windows Communication Foundation to Where is the Forum For…?)
Wednesday, October 22, 2008 5:43 AM
Answers
-
Hello Mohammed,
Thank you for your post! I would suggest posting your question in one of the MSDN > Forums Home > Visual C# located here:
http://social.msdn.microsoft.com/Forums/en-US/category/visualcsharp
Have a great day!- Proposed as answer by Kiran Polimetla Wednesday, October 29, 2008 11:50 AM
- Marked as answer by Kiran Polimetla Monday, November 17, 2008 6:47 AM
Wednesday, October 29, 2008 11:50 AM -
Or try going to the ASP.NET Forums at the following address: http://forums.asp.net/
Thanks!
Ed Price (a.k.a User Ed), SQL Server Experience Program Manager (Blog, Twitter, Wiki)
- Proposed as answer by Ed Price - MSFTMicrosoft employee Friday, April 13, 2012 4:03 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, April 13, 2012 4:03 PM
Friday, April 13, 2012 4:03 PM
All replies
-
Hello Mohammed,
Thank you for your post! I would suggest posting your question in one of the MSDN > Forums Home > Visual C# located here:
http://social.msdn.microsoft.com/Forums/en-US/category/visualcsharp
Have a great day!- Proposed as answer by Kiran Polimetla Wednesday, October 29, 2008 11:50 AM
- Marked as answer by Kiran Polimetla Monday, November 17, 2008 6:47 AM
Wednesday, October 29, 2008 11:50 AM -
Or try going to the ASP.NET Forums at the following address: http://forums.asp.net/
Thanks!
Ed Price (a.k.a User Ed), SQL Server Experience Program Manager (Blog, Twitter, Wiki)
- Proposed as answer by Ed Price - MSFTMicrosoft employee Friday, April 13, 2012 4:03 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, April 13, 2012 4:03 PM
Friday, April 13, 2012 4:03 PM