如何调试在 Windows CE 6 的 .NET CF 3.5 WinForms 应用程序中调用 Application.Exit() 后发生的致命错误?

发布于 2024-12-12 11:01:08 字数 424 浏览 1 评论 0原文

我正在将 .NET CF 1.0 WinForms 应用程序(适用于旧版本的 Windows CE)移植到 .NET CF 3.5(适用于 Windows CE 6)。问题是,在调用 Application.Exit() 几秒钟后,我会看到一个“致命错误”消息框,它只是简单地说“发生了致命错误,应用程序将终止。 ”。由于我使用的是中文版Windows CE,该消息是中文的,我不确定确切的英文消息是什么。不管怎样,错误消息随后会自动消失,并且应用程序无法完全终止并释放资源,从而导致整个操作系统变得无法使用(启动任何应用程序都会导致永久的沙漏动画,将设备停靠在其底座上也不会导致 ActiveSync)连接)直到我热启动设备。

这个致命错误的原始形式(.NET CF 1.0)显然从未在旧设备上发生过。

由于它不是 .NET 异常,因此它不会被 .NET 运行时捕获。

我能做些什么?

I am porting a .NET CF 1.0 WinForms application (for older versions of Windows CE) to .NET CF 3.5 (for Windows CE 6). The problem is that, a few seconds after Application.Exit() is called, I get a flash of a "fatal error" message box, which simply says something to the effect of "A fatal error has occurred and the application will terminate.". Since I'm using a Chinese version of Windows CE, the message is in Chinese and I'm not sure what the exact message is in English. Anyway, the error message then automatically disappears and the application fails to terminate and release resources completely, such that the whole operating system becomes unusable (launching any application would result in the perpetual hourglass animation, docking the device in its cradle also does not cause ActiveSync to connect) until I warm boot the device.

This fatal error apparently never occurred in its original form (.NET CF 1.0) on the older device.

And because it's not a .NET exception, it is not caught by the .NET runtime.

What can I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

安静 2024-12-19 11:01:08

因为您无法捕获 Application.Exit() 处发生的异常,这听起来像是您遇到了我以前见过的错误。请尝试注释掉所有设置 Font 属性的行。如果应用程序存在但没有错误消息,则您遇到的错误仅影响 WinCE 6.0 上的 NetCF 3.5。请参阅此链接 了解更多信息。

Because you can not catch the exception which is happening at Application.Exit(), this sounds like you are facing a bug I've seen before. Please try to comment out all the lines where you set the Font attribute. If the application exists without the error message, you are facing a bug which affects NetCF 3.5 at WinCE 6.0 only. See this link for more information.

抠脚大汉 2024-12-19 11:01:08

听起来像 Dispose 或 Finalizer 有一个问题,当 GC 清理房子时就会出现。检查所有应用程序终结器和所有 Dispose 覆盖。如果找不到它,请查看任何工作线程关闭(阻塞调用中的内容、读取可能无效的句柄等)。

Sounds like a Dispose or Finalizer has a problem that's showing up when the GC is cleaning house. Check all app finalizers and all Dispose overrides. If that fails to find it, look at any worker thread shutdowns (things sitting in blocking calls, reading handles that might be invalidated, etc).

离旧人 2024-12-19 11:01:08

我最近遇到了这个问题,问题是表格没有被处理。因此,我要做的就是在每次加载表单时,将表单实例添加到包含所有打开的表单的全局列表中,并在应用程序退出时循环遍历该列表,并对每个表单执行 form.dispose。这立即解决了我的问题。

I've came across this issue recently and the issue was the forms weren't being disposed. So what I had to do was on every form load I added the form instance to a global list that contained all opened forms and upon the application exit I loop through the list and did a form.dispose on each. That solved my problem instantly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文