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

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...
    enter image description here

enter image description here

  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

enter image description here

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

enter image description here

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

enter image description here

Hope this saves you some time.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)