debug a dotnet core program in terminal
12,807
Unfortunately, this is going to be a very painful experience. There's no real command line debugger available for .NET Core.
However, CoreCLR developers use a plugin for lldb
(on *nix) that teaches lldb about a number of commands that it can use to help debug .NET code.
Essentially:
lldb /path/to/dotnet/dotnet
plugin load /path/to/dotnet/shared/Microsoft.NETCore.App/*/libsosplugin.so
b SystemNative_ReceiveMessage
r run
clrstack
Further documentation:
- A tutorial: https://blogs.msdn.microsoft.com/premier_developer/2017/05/02/debugging-net-core-with-sos-everywhere/
- General setup instructions: https://github.com/dotnet/coreclr/blob/master/Documentation/building/debugging-instructions.md
- List of commands: https://github.com/dotnet/coreclr/blob/master/src/ToolBox/SOS/Strike/sosdocsunix.txt
If you start using it, you will quickly realize how painful this is. It's almost worth using VS/Rider/VSCode just for the debugger, sadly.
Related videos on Youtube
Author by
Lyze
Updated on September 14, 2022Comments
-
Lyze over 1 year
I’ve recently setup omnisharp with nvim and wanted to try to develope a dotnet core application without the help of VS/rider/vs code.
Now i tried to google around but couldn’t find any real way to debug dotnet core applications from terminal.
What’s the correct way to debug one?