.NET生产调试 [英] .NET Production Debugging

查看:102
本文介绍了.NET生产调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个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.

我没有物理访问这些客户端机器,我可以使用哪些策略进行调试?在代码中建立一些跟踪还是有其他替代方法会更好吗?

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?

谢谢。

编辑:我应该更加清楚:我得到的错误报告有堆栈跟踪,但由于它是生产代码,它并不表示导致异常的确切行,只是抛出它的方法

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.

推荐答案

一个选项是生成(mini-)转储文件,尽可能接近抛出异常的点。此文章介绍如何从托管代码执行此操作。

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

这篇关于.NET生产调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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