entity-framework - 如何获取 EntityFramework NuGet 包的 PDB 文件?

标签 entity-framework entity-framework-6 pdb

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

最佳答案

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

  • 获取 DotPeek from Jetbrains (单机版)
  • 打开DotPeek -> File -> Open -> 浏览您的项目bin文件夹并打开 EntityFramework.dll
  • 鼠标右键 EntityFramework然后选择Generate Pdb... enter image description here

  • enter image description here
  • 转到导出它的文件夹并打开EntityFramework.pdb文件夹(我知道是对的!)然后深入挖掘,直到找到一个文件 EntityFramework.pdb并将其复制到您的bin文件夹(EntityFramework.dll 旁边)。
  • 转至 Visual Studio -> DEBUG -> Options and Settings... -> Symbols然后添加您的bin文件夹到 Symbol file (.pdb) locations

  • enter image description here
  • 运行项目并祈祷那些断点变成成熟的红色....

  • 编辑:它有时会在 optimized 中开始运行 EF使调试几乎无用的模式,这是这个问题的重点——如果发生这种情况
  • 转至 Visual Studio -> Debug -> General ->(在最底部)Use Managed Compatibility Mode .勾选并运行项目(如果它得到优化然后取消勾选并运行,然后再次勾选并运行,然后....)

  • enter image description here
  • 看看有没有EF运行优化,无需等到它到达断点 转到 Visual Studio -> Debug -> Windows -> Modules .然后,当您运行解决方案模块 (2) 时,应该会出现。点击它,找到EntityFramework.dll应该有一列显示已优化(Yes = bad, No = you can debug it)。

  • enter image description here

    希望这可以节省您一些时间。

    关于entity-framework - 如何获取 EntityFramework NuGet 包的 PDB 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32104912/

    相关文章:

    c# - System.Data.Services.Client.DataServiceContext 超时属性不起作用

    c# - 在 ASP.NET Core 6 Program.cs 中配置 EF

    c# - 如何在 EF 代码优先中映射继承的实体

    .net - Entity Framework 6 with SQLite 3 Code First - 不会创建表

    c# - Entity Framework 建议无效的字段名称

    c# - "The owned entity type requires to be referenced from another entity type via a navigation"

    python - 有没有什么linux工具可以找到python程序的进程轨迹?

    python - JupyterLab 中的 pdb 未进入交互模式

    python - 使用 FIFO 在没有标准输入/标准输出的情况下运行 pdb

    .net - MVVM 应用程序中的并发架构