在应用程序崩溃时删除MSMQ队列 [英] Delete MSMQ Queue on application crash

查看:85
本文介绍了在应用程序崩溃时删除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

推荐答案

任何人?


这篇关于在应用程序崩溃时删除MSMQ队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆