gpt4 book ai didi

.net - 调试时 PDB 给我带来什么以及我如何知道它正在工作?

转载 作者:行者123 更新时间:2023-12-02 00:18:48 27 4
gpt4 key购买 nike

我必须使用没有源代码的第三方组件。我有发布DLL和发布PDB文件。我们将其称为“CorporateComponent.dll”。我自己的代码从这个 DLL 创建对象并调用这些对象的方法。

CorpObject o = new CorpObject();
Int32 result = o.DoSomethingLousy();

调试时,方法“DoSomethingLousy”抛出异常。 PDB 文件对我有什么作用?如果它有好处,我如何确定我正在使用它?

最佳答案

要确认您是否正在使用提供的 PDB CorporateComponent.pdb,请在 Visual Studio IDE 中进行调试期间查看输出窗口并找到指示 CorporateComponent.dll 已加载且后跟字符串 Symbols 的行已加载

以我的一个项目为例:

The thread 0x6a0 has exited with code 0 (0x0).
The thread 0x1f78 has exited with code 0 (0x0).
'AvayaConfigurationService.vshost.exe' (Managed): Loaded 'C:\Development\Src\trunk\ntity\AvayaConfigurationService\AvayaConfigurationService\bin\Debug \AvayaConfigurationService.exe', Symbols loaded.
'AvayaConfigurationService.vshost.exe' (Managed): Loaded 'C:\Development\Src\trunk\ntity\AvayaConfigurationService\AvayaConfigurationService\bin\Debug\IPOConfigService.dll', No symbols loaded.

Loaded 'C:\Development\src...\bin\Debug\AvayaConfigurationService.exe', Symbols loaded.

这表明 IDE 调试器已找到并加载 PDB。

正如其他人所指出的,在检查应用程序中的堆栈帧时,您应该能够看到 CorporateComponent.pdb 中的符号。如果您不这样做,那么第三方可能没有在发布的 PDB 版本中包含符号信息。

关于.net - 调试时 PDB 给我带来什么以及我如何知道它正在工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52600/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com