在应用程序崩溃时删除MSMQ队列
Hi, 我正在使用MSMQ组播.除了一件事,一切都正常.我正在为应用程序的每个实例创建一个新的队列(我希望允许用户运行该应用程序的多个实例). Im working with the MSMQ Multicast. Everything works fine except one thing. I am creating a new Queue for each instance of my application (I want to allow users to run several instances of the application). 当应用程序关闭时,处置方法将删除队列以释放资源.如果我不删除它,一段时间后,我将收到一个资源不足的异常.这也很好. When the application is shut down the dispose metod deletes the queue to free up resources. If i dont delete it, after some time I get a not enough resources exception. This works fine too. 问题是:如果我的应用程序崩溃或在调试时通过Visual Studio将其关闭,则不会调用处理方法,也不会删除队列.有什么可能的方法来设置队列上的默认删除/杀死时间?任何其他最好的
练习或任何可以解决我的问题的模式? The problem is: If my application crashes or i shut it down through visual studio while debugging the dispose methos is not called and the queue not deleted. Is there any possible way to set a default delete/kill time on the queue? Any other best
practice or any pattern that will solve my problem? 感谢 shz
任何人?