Microsoft KB Archive/840147

From BetaArchive Wiki

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.

MORE INFORMATION

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 "Symptoms" section.


REFERENCES

For additional information, visit the following Microsoft Developer Network (MSDN) Web sites:

MessageQueue.ClearConnectionCache method

MessageQueue.EnableConnectionCache property

Sending and serializing messages

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

315736 How to secure an ASP.NET application by using Windows security


315698 How to write to and read from Microsoft Message Queue Server in Visual Basic .NET


815811 How to write to and read from Microsoft Message Queue Server in Visual C# .NET


Keywords: kbtshoot kbMsg kbUser kbProperties kblogin kbCaching kbprb KB840147
Technology: kbAudDeveloper kbMSMQ100 kbMSMQ200 kbMSMQ300 kbMSMQSearch kbNETFrame100 kbNETFrame110 kbNETFrameSearch