在发布模式下部署时访问 StackTrace [英] Access the StackTrace when deploying in Release mode

查看:16
本文介绍了在发布模式下部署时访问 StackTrace的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不完全确定在发布模式下部署时 StackTrace 是否无法正常工作,但是,我们希望记录所有异常,以便在部署时可以更轻松地跟踪错误,当然,在调试模式下部署是不是一个选择.我们需要从 StackTrace 类获取的信息是文件名、方法和发生异常的行号.

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.

我需要什么设置才能从 StackTrace 中获取这三个值并最小化在调试模式下部署带来的额外调试信息?

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 问题:

如何生成 PDB对于处于发布模式的 .net 管理项目?(干杯,尼克)

从 C# 打印堆栈跟踪信息

是否在 RELEASE 程序集中显示有用的异常 StackTrace 或仅在 DEBUG .dll 中显示

这篇关于在发布模式下部署时访问 StackTrace的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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