程序和调试器在没有问题迹象的情况下退出 [英] Program and debugger quit without indication of problem

查看:32
本文介绍了程序和调试器在没有问题迹象的情况下退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 WPF 应用程序.调试的时候,逻辑到了某个点,然后应用就无缘无故的退出了.VS 调试器什么也没发现,唯一的问题迹象是输出窗口中的以下内容:

I'm developing a WPF application. When debugging, the logic reaches a certain point, then the application quits for no reason. VS debugger catches nothing and the only indication of a problem is the following in the output window:

程序[6228] SomeApp.vshost.exe: Managed (v4.0.30319)"已退出,代码为 1073741855 (0x4000001f).

The program '[6228] SomeApp.vshost.exe: Managed (v4.0.30319)' has exited with code 1073741855 (0x4000001f).

在调试发布版本时,或者确实在调试器之外运行调试版本(实际上所有未在调试器中运行调试版本的组合)时,一切正常.

When debugging the release version, or indeed running the debug build out of the debugger (in fact all combos that aren't running the debug version in debugger), everything works fine.

我正在尝试使用以下代码捕获未处理的异常:

I'm trying to catch unhandled exceptions with the following code:

        AppDomain
            .CurrentDomain
            .UnhandledException +=
            (sender, e) =>
            {
                Debug.WriteLine("Unhandled Exception " + e.ExceptionObject);
            };
        Application
            .Current
            .DispatcherUnhandledException +=
            (sender1, e1) =>
            {
                Debug.WriteLine("DispatcherUnhandledException " + e1.Exception);
            };

...但我什么也没发现.

...but I'm not catching anything.

我正在考虑使用调试输出语句填充应用程序,但它是高度异步的,因此阅读本文将既费力又乏味.

I'm considering peppering the app with debug output statements, but it's highly asynchronous so reading this will be both arduous and tedious.

我如何开始弄清楚发生了什么?

How do I start figuring what is going on?

推荐答案

根据 ntstatus.h 文件,0x4000001f (STATUS_WX86_BREAKPOINT) 是 Win32 x86 仿真子系统使用的异常状态代码.它(我想)意味着您到达了一个不可利用的断点.您应该启用调试非托管代码.

According to ntstatus.h file, 0x4000001f (STATUS_WX86_BREAKPOINT) is an exception status code that is used by the Win32 x86 emulation subsystem. It (I suppose) means that you reached a breakpoint which is not exploitable. You should enable debugging unmanaged code.

这篇关于程序和调试器在没有问题迹象的情况下退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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