Microsoft KB Archive/840147

= Message Queuing continues to use the credentials of the user who logs on first to a .NET application =

PSS ID Number: 840147

Article Last Modified on 10/7/2004

-

The information in this article applies to:


 * Microsoft Message Queue Server (MSMQ) 3.0
 * Microsoft Message Queue Server (MSMQ) 2.0
 * Microsoft Message Queue Server (MSMQ) 1.0
 * Microsoft .NET Framework 1.1
 * Microsoft .NET Framework 1.0

-





SYMPTOMS
When multiple users send messages from a Microsoft .NET application to a message queue, you may notice that all the messages that are sent may have the credentials of the user who logs on first to the .NET application.



CAUSE
The Microsoft .NET Framework uses a connection cache that stores queue handles.



RESOLUTION
To resolve this problem, you can use either of the following methods:
 * Set the EnableConnectionCache property of the MessageQueue object to false in your .NET application code.
 * Use the ClearConnectionCache method of the MessageQueue object in your .NET application code. Do this instead of calling the Close method of the MessageQueue object.



STATUS
This behavior is by design.



Steps to reproduce the problem

 * 1) Create a Microsoft ASP.NET application that sends the messages to a queue.
 * 2) Make sure that the ASP.NET application is configured to use impersonation of the logged-on user.
 * 3) Permit multiple users to log on to the application and to send messages.

You may notice the problem that is mentioned in the &quot;Symptoms&quot; section.

