是堆栈跟踪信息.NET发布模式构建可用?堆栈、模式、信息、NET

2023-09-03 15:13:00 作者:男人必须傲

如果我选择释放模式建立一个DLL,是堆栈跟踪信息,还有吗?

If I choose release mode to build a dll, is the stacktrace information still available?

如果是这样,那么什么样的信息的是的发布模式不可用?

If so, then what information is unavailable in release mode?

推荐答案

您总是有堆栈跟踪信息 - 这是一个运行时功能无关的构建模式 - 但行号和源文件名是发行版本堆栈通常不可用痕迹。

You always have stack trace information--that's a runtime feature unrelated to the build mode--but line numbers and source file names are normally unavailable in release build stack traces.

您可以通过改变构建配置创建完整的程序数据库(.PDB)文件,同时获得行号和源文件名称的发布版本堆栈跟踪(包括例外)。要做到这一点在Visual Studio中:

You can get both line numbers and source file names in release build stack traces (including in exceptions) by altering the build configuration to create full program database (.pdb) files. To do so in Visual Studio:

打开项目的属性页 选择Release配置 去生成选项卡,然后单击高级按钮 选择在调试信息下拉全。

请注意,如果.pdb文件部署沿着你的应用程序,这将不仅有助于。

Note that this will only help if the .pdb files are deployed alongside your application.