C
C#2y ago
yanny2

❔ 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
Angius
Angius2y ago
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
yanny2
yanny2OP2y ago
I have installed a C# extension
Angius
Angius2y ago
Is the extension called "DevKit"?
yanny2
yanny2OP2y ago
No, I do not see any extension by that name.
yanny2
yanny2OP2y ago
This is what I have installed
No description
Pobiega
Pobiega2y ago
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
yanny2
yanny2OP2y ago
I am not inviting the antichrist onto my computer, is there an alternative ?
Angius
Angius2y ago
Rider
yanny2
yanny2OP2y ago
Same kind of evil
Angius
Angius2y ago
Or that one debugger by Samsung: https://github.com/Samsung/netcoredbg
yanny2
yanny2OP2y ago
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
Pobiega
Pobiega2y ago
if you are this against microsoft and their products, probably
yanny2
yanny2OP2y ago
Unfortunately I am relying on a Raw file IO lib that is written in C#
Pobiega
Pobiega2y ago
the runtime is also made by microsoft, as is the sdk
yanny2
yanny2OP2y ago
So I'll have to rewrite that too
Pobiega
Pobiega2y ago
¯\_(ツ)_/¯ You do you
yanny2
yanny2OP2y ago
There is mono but that is kinda a joke as far as I know
Pobiega
Pobiega2y ago
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
reflectronic
reflectronic2y ago
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.
reflectronic
reflectronic2y ago
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
yanny2
yanny2OP2y ago
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.
Accord
Accord2y ago
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.

Did you find this page helpful?