.NET生产调试NET

2023-09-04 09:39:49 作者:长空夕醉

我已经在生产了一段时间一个Windows应用程序,现在,把它设置给我们发送错误报告时,它抛出异常。其中大部分是相当描述,帮助我很快找到问题(我用的是MS应用程序异常块)。

I've had a Windows app in production for a while now, and have it set up to send us error reports when it throws exceptions. Most of these are fairly descriptive and help me find the problem very quickly (I use the MS Application Exception Block).

有几次我有报道说是我无法重现的问题,并且似乎只发生在少数客户机。

On a few occasions I have reports that are issues that I can't reproduce, and seem to only happen on a few client machines.

我没有这些客户机进行物理访问,都有些什么策略,我可以使用调试?会是更好地建设一些追查到code,或者是有一些其他的选择吗?

I don't have physical access to these client machines, what are some strategies I can use for debugging? Would it be better to build some tracing into the code, or are there some other alternatives?

感谢你。

编辑:我应该更明确:该错误报告,我得到确实有堆栈跟踪,但因为它是生产code,它并不表示导致异常的确切路线,只是在方法它被抛出。

I should have been more clear: The error reports that I get do have the stack trace, but since it's production code, it doesn't indicate the exact line that caused the exception, just the method in which it was thrown.

推荐答案

一种选择是生成(迷你)转储文件作为接近的地方抛出异常尽可能的地步。该文章有关如何从管理code为此举行了会谈。

One option is to generate a (mini-)dump file as close to the point where the exception is thrown as possible. This article talks about how to do this from managed code.

您便可以装载转储文件到Visual Studio或WinDbg中并用的 SOS

You could then load the dump file into Visual Studio or WinDbg and examine it with the aid of SOS