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