I have a Nunit test which adds message into MSMQ. In the teardown of the NUnit i want to remove all the message from the queue. Is there a direct way to remove all the messages from the queue (some kind of refresh) ?
+2
A:
Is there a Purge() method on your queue object that would do the trick?
Edit: Yup - seems to be: http://msdn.microsoft.com/en-us/library/ms703966%28VS.85%29.aspx
Andrew M
2009-09-02 17:14:32
Thanks that solved the problem
Balaji
2009-09-02 17:18:00
And the .NET method reference is here: http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.purge.aspx
Jeff Sternal
2009-09-02 17:27:14