English 中文(简体)
.NET应用程序引发哪些异常
原标题:What Exceptions Is .NET App Throwing

我正在使用一个别人写的.NET应用程序,我可以看到它今天更新得很慢。使用Process Explorer,我看到它抛出了成千上万的异常(这些异常可能被应用程序以某种方式捕获)。

如果我不能访问源代码,有什么方法可以查看这些异常是什么类型的吗?Process Explorer只有一个“抛出的异常数”计数器。但有什么工具可以告诉我吗?

最佳回答

将调试器附加到进程,您应该能够知道异常是什么,只是不能知道它们在源代码中来自哪里。

确保异常设置设置正确。即使没有这一点,你也总能在“输出”窗口中看到应用程序捕捉并忽略的首次机会异常。这可能是一个合法但不明智的“抛出处理错误”应用程序命中的代码路径。

如果您没有对机器的调试访问权限,则进程转储程序可以安装,并在选定或所有异常上从目标进程(通过.EXE文件名)生成完整或小型转储。不过,我认为这不适用于托管异常。调试器将同时适用于托管和本机异常。

问题回答

我相信您可以使用windbg捕获内存转储并对其进行分析,以发现这些异常。

我自己没有使用它的经验,使用它可能会导致应用程序离线。





相关问题
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. ...

热门标签