当存在未处理的异常时停止应用程序崩溃 [英] Stopping application crashing when there is an unhandled exception

查看:70
本文介绍了当存在未处理的异常时停止应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我最近将.Net 1.1应用程序移植到了.Net 2.0以及一个新的

功能紧张的是,当有一个未处理的

异常时,应用程序完全崩溃,导致用户松开所有他们已经完成的工作,他们之前只需点击继续。 >
,99%的情况可以。有没有一个选项可以让这个烦人的

崩溃并且关闭所有选项,我可以看到它有它的优点但是在我的情况下它只是烦人的




Joe。

Hi,

I''ve recently ported a .Net 1.1 application to .Net 2.0 and the one new
feature that is getting on my nerves is that when there is an unhandled
exception the application completely crashes, causing user to loose all
the work they have done where they could previously just click continue
and in 99% of cases be fine. Is there an option to turn this annoying
crash and loose everything option off, I can see it has its merits but
in my case its just annoying.

Joe.

推荐答案

< jo ************ **@hotmail.com写信息

新闻:11 ********************* @ s34g2000cwa.googlegro ups.com ...
<jo**************@hotmail.comwrote in message
news:11*********************@s34g2000cwa.googlegro ups.com...

我最近将一个.Net 1.1应用程序移植到.Net 2.0和一个新的

功能让我紧张不安就是当有一个未处理的

异常时,应用程序完全崩溃,导致用户松开所有他们已经完成的工作,他们之前只需点击继续

和99%的情况都可以。是否有一个选项可以让这个恼人的

崩溃并且松开一切选项,我可以看到它有它的优点但是在我的情况下它只是令人讨厌的

I''ve recently ported a .Net 1.1 application to .Net 2.0 and the one new
feature that is getting on my nerves is that when there is an unhandled
exception the application completely crashes, causing user to loose all
the work they have done where they could previously just click continue
and in 99% of cases be fine. Is there an option to turn this annoying
crash and loose everything option off, I can see it has its merits but
in my case its just annoying.



好​​吧,我猜的第一个问题是为什么会有一个未处理的

例外......?你没有使用异常处理吗?

尝试...抓住[...最后]?


其次,为什么你的Global.asax没有Application_Error

例程......?

Well, the first question I guess is why might there be an unhandled
exception...? Are you not using exception handling i.e.
Try...Catch[...Finally]?

Secondly, why does your Global.asax not have an Application_Error
routine...?




Mark Rae写道:

Mark Rae wrote:

< jo ************** @ hotmail.comwrote in message

news:11 ********* ************@s34g2000cwa.googlegro ups.com ...
<jo**************@hotmail.comwrote in message
news:11*********************@s34g2000cwa.googlegro ups.com...

我最近移植了一个.Net 1.1应用程序.Net 2.0和一个让我紧张的新的
功能是当有一个未处理的

异常时,应用程序完全崩溃,导致用户松动所有/>
他们以前只需点击继续工作的工作

并且99%的情况都没问题。是否有一个选项可以让这个恼人的

崩溃并且松开一切选项,我可以看到它有它的优点但是在我的情况下它只是令人讨厌的

I''ve recently ported a .Net 1.1 application to .Net 2.0 and the one new
feature that is getting on my nerves is that when there is an unhandled
exception the application completely crashes, causing user to loose all
the work they have done where they could previously just click continue
and in 99% of cases be fine. Is there an option to turn this annoying
crash and loose everything option off, I can see it has its merits but
in my case its just annoying.



嗯,我猜的第一个问题是为什么会有一个未处理的

例外......?你没有使用异常处理吗?

尝试...抓住[...最后]?


其次,为什么你的Global.asax没有Application_Error

例程...?


Well, the first question I guess is why might there be an unhandled
exception...? Are you not using exception handling i.e.
Try...Catch[...Finally]?

Secondly, why does your Global.asax not have an Application_Error
routine...?



异常的主要原因是

控件上的跨线程异常,我知道可以设置为允许但我确实想要根目录

他们全部出局。另外作为一般偏好,如果一个新的bug找到它的方式

我希望用户至少可以选择尝试继续。


它处理AppDomain.CurrentDomain.UnhandledException;记录

问题,如果这就是你的意思,但在此之后申请仍然是

退出。


所有我''我真的问有没有办法避免应用程序在未处理的异常上关闭

,而不是如何避免未处理的异常。

The main cause of exceptions has been cross thread exceptions on
controls, which I know can be set to be allowed but I do want to root
them all out. Also as a general preference if a new bug finds its way
in I''d prefer the user to at least have the option to try to continue.

It handles the "AppDomain.CurrentDomain.UnhandledException" to log the
problem if thats what you mean, but after this the application still
exits.

All I''m really asking is there a way to avoid the application closing
on an unhandled exception, not how to avoid unhandled exceptions.


< jo ************** @ hotmail.comwrote in message

news:11 *************** ****** @11g2000cwr.googlegrou ps.com ...
<jo**************@hotmail.comwrote in message
news:11*********************@11g2000cwr.googlegrou ps.com...

它处理AppDomain.CurrentDomain.UnhandledException记录

问题,如果这就是你的意思,但在此之后申请仍然是

退出。


所有我''我真的问有没有办法避免应用程序在未处理的异常上关闭

,而不是如何避免未处理的异常。
It handles the "AppDomain.CurrentDomain.UnhandledException" to log the
problem if thats what you mean, but after this the application still
exits.

All I''m really asking is there a way to avoid the application closing
on an unhandled exception, not how to avoid unhandled exceptions.

http:// www。 developer.com/net/asp/article.php/961301


这篇关于当存在未处理的异常时停止应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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