❔ How do I configure and use 'vscode' for debugging purposes?
Hello, I have recently been attempting to write a C# program, and I am at the stage where I need to break and inspect. Normally I would use gdb for this, but apparently it doesn't work with pdb produced by dotnet build.
As a consequence I have had to install some software called vs-code or codium in my package manager.
I have managed to open the project and set a breakpoint, but upon pressing F5 which I presume is the run button, I get an ambiguous error that states: "undefined" is not valid JSON.
This is somewhat confusing as my project doesn't contain any JSON, What do I need to configure this software so that it functions?
24 Replies
If you must use VS Code, you'll need the DevKit extension to be able to work with C# code properly
Not sure if it will work with VS Codium though
I have installed a C# extension
Is the extension called "DevKit"?
No, I do not see any extension by that name.
This is what I have installed
"C# Dev Kit" it's called, by Microsoft: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit
Codium does not support the debugger. Only the official VS Code works
so if this is something like arch, make sure its the vs code binary package
I am not inviting the antichrist onto my computer, is there an alternative ?
Rider
Same kind of evil
Or that one debugger by Samsung: https://github.com/Samsung/netcoredbg
This is what this uses, but it doesn't work as far as I can tell.
Maybe it would be prudent to just rewrite the entire thing in a different language
if you are this against microsoft and their products, probably
Unfortunately I am relying on a Raw file IO lib that is written in C#
the runtime is also made by microsoft, as is the sdk
So I'll have to rewrite that too
¯\_(ツ)_/¯
You do you
There is mono but that is kinda a joke as far as I know
mono was an alternative runtime for .net framework
we dont use .net framework these days, if it can be avoided
since .NET is multiplatform since 2016
if you want the free software debugger then you can use https://github.com/Samsung/netcoredbg
GitHub
GitHub - Samsung/netcoredbg: NetCoreDbg is a managed code debugger ...
NetCoreDbg is a managed code debugger with MI interface for CoreCLR. - GitHub - Samsung/netcoredbg: NetCoreDbg is a managed code debugger with MI interface for CoreCLR.
you can use it as a command-line debugger, though it also supports GDB MI and VS Code. there is a fork of the C# extension which uses it out of the box https://github.com/muhammadsammy/free-omnisharp-vscode
I have already achieved functional parity by rewriting the entire thing in python, which is also trivial to debug. Thank you all for the time and information regardless.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.