EF Core CLI Tools prerequisits for attaching the debugger

debugging entity-framework-core visual-studio-2017

Question

I was trying to debug the OnModelCreated from my DBContext as described here: EF Core Add Migration Debugging by inserting System.Diagnostics.Debugger.Launch()

Then I ran the > dotnet ef migrations list command and got the prompt for attaching a Debugger. I choose the running VS, where the correct solution was loaded.

Then I saw disassembled files and warnings about not finding the debugger.cpp and whatsoever. I choose to set a breakpoint directly after the aforementioned Debugger.Launch() which then told me

Breakpoint, will not be hit, since no symbols have been loaded"

Well - the module window, will most likely know something about that.
So openening the module window and looking for my .dll. - There it is - with a small red cross on top.

Right-Click to the module: Symbol load information states:

This module is a pre-compiled binary created by the ngen.exe tool. The debugger does not attempt to load symbols for these binaries, but will instead load symbols for original dll/exe when it is loaded by the .NET Runtime.

And Symbol Status from the File states:
| Name | SymbolStatus | Process |
| DataAccess.Migrations.dll | Native debugger skipped loading symbols for managed module. | [21808] dotnet.exe |

As I write this, it seems, VS tries to debug the native code instead of the managed code. Is there a way to solve this or jump into "mixed mode debugging"?

1
0
2/9/2018 8:58:12 AM

Popular Answer

It seems the debugger is skipping files not in the .NET environment. Solution: Check Debugging -> General -> Enable Just My Code

For mixed mode: Project name -> properties-> debugging -> Debugger Type:

enter image description here

0
2/12/2018 9:08:22 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow