English 中文(简体)
wpf 无处理性例外
原标题:wpf unhandled exception

In my WPF application some users get "application generated an exception that can not handle" error. I ve implemented Application.DispatcherUnhandledException event handler but the the exception isn t handled by this event. Is there any possibility that exception occurs outside application causing closing my application, maybe something with memory?

最佳回答

您可以尝试的一件事是,除发送者外,还要听取申请人提出的例外情况。

AppDomain.CurrentDomain.UnhandledException += 
        new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

This should, in theory, catch all exceptions related to your application and not just ones running within the Dispatcher.

问题回答

您是否试图在申请启动时添加这一点?

AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

在我的经验中,如果只有一些用户出现错误(而且这些用户在时间上都会发现错误),那么项目文件参考资料可能会在不把“To Local”财产确定为真实的情况下,因此假定所有用户都安装了GAC的批号,而某些用户可能不会这样做。

如果你的手稿被叫作,但例外情况仍未处理,则有必要处理以下活动:e.Handled=true; see:。 • 如何制止《国际不动产合同》中的例外规定?





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签