Visual Studio“发生未处理的 win32 异常"经常点击按钮时 [英] Visual Studio "An unhandled win32 expcetion occured" when clicking button often

查看:63
本文介绍了Visual Studio“发生未处理的 win32 异常"经常点击按钮时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 C# UWP-Win10 应用程序有一个奇怪的问题.当我经常调整窗口大小或经常点击随机按钮(> 3 次)时,我收到错误:

I have a strange issue with my C# UWP-Win10 app. When I re-size the window often or clicking a random button often (>3 times), I'm getting the error:

bla.exe [bla-id] 中发生未处理的 win32 异常

An unhandled win32 exception occurred in bla.exe [bla-id]

关闭此窗口后,应用程序崩溃并在输出窗口中得到:

After closing this window the app crashes and in the output-window I get:

程序[bla-id] bla.exe"已退出,代码为 -1073741811 (0xc000000d).

The program '[bla-id] bla.exe' has exited with code -1073741811 (0xc000000d).

没有来自 Visual Studio 的更多信息.我在这个应用程序中使用串口,​​我注意到这个错误只有在我连接到设备时才会发生.但是:我添加了一个空按钮(没有点击处理程序),并且这个按钮上发生了同样的错误.

No more information from Visual Studio. I'm using the serial-port in this app and I've noticed that this error occurs only when I'm connected to the device. But: I've added an empty button (without a Click-handler) and the same error occurs on this button.

此外,我查看了事件查看器并看到了崩溃的模块:

Additionally I've looked in the eventviewer and saw the crashed-module:

ntdll.dll (偏移量 0x00000000000f5670)

ntdll.dll (offset 0x00000000000f5670)

我如何追踪问题?我没有使用外部 API 或其他东西.

How can I trace down the issue? I'm not using external APIs or something else.

推荐答案

经过一段时间(两周)的测试和调试后,我发现了问题:垃圾收集器正在关闭串行端口输入流因此 DataReader(正在读取串行端口)立即死亡并抛出此未指定的异常.基本上这是数据读取器未在代码中正确处理的问题.谜"解开了.

After a while (two weeks) of testing and debugging I've found the issue: The garbage collector is closing the serialport inputstream and thus the DataReader (which is reading the serialport) dies instantly and throws this unspecified exception. Basically this was an issue with the datareaader not disposing correctly in code. "Mystery" solved.

这篇关于Visual Studio“发生未处理的 win32 异常"经常点击按钮时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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