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?
Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.
You can do this by clicking on the arrow next to Run button in Visual Studio and selecting 'Project Debug Properties'. From there, you can go to 'Application Arguments' and enter the arguments you want.
To debug . NET and ASP.NET Core source code in Visual Studio: In Tools -> Options -> Debugging -> General, un-check Enable Just My Code. Verify Enable Source Link support is checked.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With