在释放模式部署时,访问堆栈跟踪 [英] Access the StackTrace when deploying in Release mode
问题描述
我不能完全肯定,如果堆栈跟踪不会在释放模式部署时正常工作,但是,我们当然要记录所有的异常,所以我们可以做出部署时的bug跟踪更容易,而且,部署在调试模式不是一种选择。我们从栈跟踪类需要的信息是所述文件名中,该方法,并在其中发生异常的行号。
I'm not entirely sure if the StackTrace does not work correctly when deploying in release mode, however, we want to log all the exceptions so we can make bug tracking easier when deploying, and of course, deploying in debug mode is not an option. The info we need from the StackTrace class is the file name, the method, and the line number in which the exception occurred.
做了什么设置,我需要得到的堆栈跟踪这三个值,并尽量减少额外的调试信息,部署在调试模式带来了?
What settings do I need to get these three values from the StackTrace and minimize the extra debugging info that deploying in Debug mode brings?
感谢。
推荐答案
您需要为了做部署 .PDB
符号文件,在释放模式(和可能关闭一些最佳化,这可能会或可能不会被接受)。
You would need to deploy your .pdb
symbol files in order to do that in Release mode (and possibly turn off some optimisations, which may or may not be acceptable).
相关SO问题:
-
<一个href="http://stackoverflow.com/questions/628565/display-lines-number-in-stack-trace-for-net-assembly-in-release-mode">Display在发行模式下,行数堆栈跟踪的.NET程序集
<一个href="http://stackoverflow.com/questions/585397/how-to-generate-pdbs-for-net-managed-projects-in-release-mode">How生成PDB对.NET托管项目在发布模式?(欢呼声中,尼克)
从C#打印堆栈跟踪信息
<一个href="http://stackoverflow.com/questions/1850253/is-showing-the-exception-stacktrace-useful-in-a-release-assembly-or-only-a-debug">Is显示异常堆栈跟踪在释放组件有用的或只是一个DEBUG .DLL
这篇关于在释放模式部署时,访问堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!