更新时间:2023-01-30 21:48:02
打开设置:工具->选项->调试->符号并添加您的.PDB文件所在的目录.
Open Settings: Tools->Options -> Debugging -> Symbols and add directory, where your .PDB files are located.
您可以为每个项目添加自定义路径,也可以编辑公共路径,Visual Studio 将在其中保存所有 .pdb 缓存.
You can add custom path, like for each project, and also you can edit common path, where Visual Studio will save all .pdb cache.
我在每个项目中进行了编译后事件,将所有 .pdb 复制到一个文件夹中,这样我就将所有内容放在一个地方.但是您可以单独存储它,我发现这不太方便,因为每次编辑位置列表时都需要.
I made in each project post-compile event, which copy all .pdb to one folder, by this i have all in one place. But you can store it separately, which i found not so convenient, as it require each time edit list of locations.
将 .pdb 和 .dll 复制到 Symbols 缓存位置的调试后脚本示例:
xcopy /Y /R "$(TargetDir)$(ProjectName).pdb" "D:\VS_CACHE\"
xcopy /Y /R "$(TargetDir)$(ProjectName).dll" "D:\VS_CACHE\"
当您处于调试模式时,由于某种原因找不到符号,可能是由于多种原因:
要将 VS Debugger 重新附加到正在运行的应用程序,我建议使用这个免费的 Visual Studio 附加组件(支持 VS 2015):
To re-attach VS Debugger to running application, i recommend to use this free Visual Studio add-on (support VS 2015):
重新连接:visualstudiogallery.msdn.microsoft.com/8cccc206-b9de-42ef-8f5a-160ad0f017ae
ReAttach: visualstudiogallery.msdn.microsoft.com/8cccc206-b9de-42ef-8f5a-160ad0f017ae
它会为您节省很多时间!:)
It will save you a lot of time! :)