我怎样才能包括堆栈跟踪行号没有PDB? [英] How can I include line numbers in a stack trace without a pdb?

查看:289
本文介绍了我怎样才能包括堆栈跟踪行号没有PDB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我们正在分发没有.pdb文件WinForms应用程序,以节省在客户机和下载带宽空间。当我们的堆栈跟踪,我们得到方法的名称,但没有行号。有没有什么办法让行号,而不是诉诸分发.pdb文件?

We are currently distributing a WinForms app without .pdb files to conserve space on client machines and download bandwidth. When we get stack traces, we are getting method names but not line numbers. Is there any way to get the line numbers without resorting to distributing the .pdb files?

推荐答案

您不能直接行号的堆栈跟踪从您的应用程序,除非你捆绑PDB。 然而的,如果你有,你运送到客户的PDB文件的应用程序相同的版本,你不介意一些轻的脚本,那么你的可以的转在.NET堆栈跟踪和IL弥补回行号。

You can't get a stack trace with line numbers directly from your application unless you bundle the PDB. However, if you have the PDB files for the same version of the app that you ship to your customers, and you don't mind some light scripting, then you can turn the .NET stack trace and IL offsets back into line numbers.

在你的构建过程中,使用迈克失速的pdb​​2xml器,分布情况他出色的 MDBG的一部分管理code调试和商店他们一些安全的地方(例如,源代码控制)。当您从客户端得到一个堆栈跟踪,您可以查询IL从XML数据偏移量来确定相关的行号。如果您的堆栈跟踪得到提交到一个网站,你甚至可以自动进行转换,使开发人员已经由当时的情况下,击中了他们的收件箱中获得充分详细的堆栈跟踪。

During your build process, use Mike Stall's pdb2xml converter, distributed as part of his excellent MDbg managed code debugger, and store them some place secure (e.g., source control). When you get a stack trace back from the client, you can query the IL offset from the XML data to determine the relevant line number. If your stack traces get submitted to a website, you can even automate the conversion, so that developers will already be getting fully detailed stack traces by the time the cases hit their inbox.

这篇关于我怎样才能包括堆栈跟踪行号没有PDB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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