如何获取 EntityFramework NuGet 包的 PDB 文件? [英] How can I get a PDB file for the EntityFramework NuGet package?

查看:13
本文介绍了如何获取 EntityFramework NuGet 包的 PDB 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 EntityFramework NuGet 包(版本 6.1.3)中调试 StackOverflow.为了查看堆栈帧,我需要 EntityFramework.DLL 和 EntityFramework.SqlServer.DLL 的 PDB 文件.但是,我似乎无法让 Visual Studio 从 MSFT 符号源或 SymbolSource.org 下载它(我可以获得其他系统 PDB 和 NewtonSoft.json 之类的东西).EF PDB 在任何地方都可用吗?

解决方案

现在有图片了(因为我花了大约一个小时的时间尝试并失败了)

  1. 从 Jetbrains 获取

  1. 转到您导出它的文件夹并打开 EntityFramework.pdb 文件夹(我知道!)然后深入挖掘,直到找到一个文件 EntityFramework.pdb并将其复制到您的 bin 文件夹(EntityFramework.dll 旁边).

  2. 转到 Visual Studio -> DEBUG -> 选项和设置... -> 符号 然后将您的 bin 文件夹添加到 符号文件 (.pdb) 位置

  1. 运行项目并祈祷那些断点变成成熟的红色......

它有时会在 optimized 模式下开始运行 EF,这使得调试几乎毫无用处,这是这个问题的重点——如果发生这种情况

  1. 转到 Visual Studio -> Debug -> General ->(在最底部)使用托管兼容模式.勾选并运行项目(如果它得到优化然后取消勾选并运行,然后再次勾选并运行,然后......)

  1. 查看 EF 是否运行优化,无需等到它遇到断点 Go to Visual 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)

  1. Get DotPeek from Jetbrains (Standalone version)

  2. Open DotPeek -> File -> Open -> browse to your project bin folder and open EntityFramework.dll

  3. Right mouse button on EntityFramework then choose Generate Pdb...

  1. Go to folder where you exported it and open EntityFramework.pdb folder (I know right!) then dig deeper till you find a file EntityFramework.pdb and copy it to your bin folder (next to EntityFramework.dll).

  2. Go to Visual Studio -> DEBUG -> Options and Settings... -> Symbols then add your bin folder to Symbol file (.pdb) locations

  1. 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

  1. 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 ....)

  1. To see if EF runs optimized without having to wait till it hits breakpoint Go to Visual Studio -> Debug -> Windows -> Modules. Then when you run solution modules (2) should appear. Click it and find EntityFramework.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屋!

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