How can I get a PDB file for the EntityFramework NuGet package?

后端 未结 3 688
小蘑菇
小蘑菇 2020-12-29 20:08

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 E

相关标签:
3条回答
  • 2020-12-29 20:41

    Download the source code: entity framework on codeplex

    The download button is in the sub-menu on the Source tab

    Once downloaded:

    • Build the solution/project

    • Navigate to the bin directory NB: it is not in the normal location, its set to "..\..\bin\Debug\". See Project properties.

    The EntityFramework.pdb and the EntityFramework.SqlServer.pdb are both there.

    Also would of thought, it would be available by default or easier.

    0 讨论(0)
  • 2020-12-29 20:42

    One of the ways is to use dotpeek as symbol server (load entity framework dll and add dotpeek serer address copied from dotpeek settings) - what is great about this approach, that it generated pdb matching used dll version automatically, what is not so great - it will not contain original comments from source code, etc.

    0 讨论(0)
  • 2020-12-29 20:47

    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.

    0 讨论(0)
提交回复
热议问题