如何获取 EntityFramework NuGet 包的 PDB 文件? [英] How can I get a PDB file for the EntityFramework NuGet package?
问题描述
我正在尝试在 EntityFramework NuGet 包(版本 6.1.3)中调试 StackOverflow.为了查看堆栈帧,我需要 EntityFramework.DLL 和 EntityFramework.SqlServer.DLL 的 PDB 文件.但是,我似乎无法让 Visual Studio 从 MSFT 符号源或 SymbolSource.org 下载它(我可以获得其他系统 PDB 和 NewtonSoft.json 之类的东西).EF PDB 在任何地方都可用吗?
现在有图片了(因为我花了大约一个小时的时间尝试并失败了)
从 Jetbrains 获取
转到您导出它的文件夹并打开
EntityFramework.pdb
文件夹(我知道!)然后深入挖掘,直到找到一个文件EntityFramework.pdb
并将其复制到您的bin
文件夹(EntityFramework.dll
旁边).转到
Visual Studio
->DEBUG
->选项和设置...
->符号
然后将您的bin
文件夹添加到符号文件 (.pdb) 位置
- 运行项目并祈祷那些断点变成成熟的红色......
它有时会在 optimized
模式下开始运行 EF,这使得调试几乎毫无用处,这是这个问题的重点——如果发生这种情况
- 转到
Visual Studio
->Debug
->General
->(在最底部)使用托管兼容模式代码>.勾选并运行项目(如果它得到优化然后取消勾选并运行,然后再次勾选并运行,然后......)
- 查看
EF
是否运行优化,无需等到它遇到断点 Go toVisual Studio
->Debug
->窗口
->模块
.然后,当您运行解决方案模块 (2) 时,应该会出现.点击它,找到EntityFramework.dll
应该有一列说 Optimized(Yes
= bad,No
= you can debug it).李>
希望这可以为您节省一些时间.
I'm trying to debug a StackOverflow in the EntityFramework NuGet package (version 6.1.3). In order to see the stack frames I need the PDB file for EntityFramework.DLL and EntityFramework.SqlServer.DLL. However, I can't seem to get Visual Studio to download this from either the MSFT symbol sources or from SymbolSource.org (I can get other System PDBs and things like NewtonSoft.json). Are the EF PDBs available anywhere?
Now with pictures (as it took me about an hour of trial and fail)
Get DotPeek from Jetbrains (Standalone version)
Open
DotPeek
->File
->Open
-> browse to your projectbin
folder and openEntityFramework.dll
Right mouse button on
EntityFramework
then chooseGenerate Pdb...
Go to folder where you exported it and open
EntityFramework.pdb
folder (I know right!) then dig deeper till you find a fileEntityFramework.pdb
and copy it to yourbin
folder (next toEntityFramework.dll
).Go to
Visual Studio
->DEBUG
->Options and Settings...
->Symbols
then add yourbin
folder toSymbol file (.pdb) locations
- Run project and pray those breakpoints turn ripe red....
Edit: It sometimes starts running EF in optimized
mode that renders debugging pretty much useless which is a whole point of this question - if this happens
- Go to
Visual Studio
->Debug
->General
-> (at the very bottom)Use Managed Compatibility Mode
. Tick and Run project (if it gets optimized then untick and run, then tick again and run, then ....)
- To see if
EF
runs optimized without having to wait till it hits breakpoint Go toVisual Studio
->Debug
->Windows
->Modules
. Then when you run solution modules (2) should appear. Click it and findEntityFramework.dll
there should be column that says Optimized(Yes
= bad,No
= you can debug it).
Hope this saves you some time.
这篇关于如何获取 EntityFramework NuGet 包的 PDB 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!