That's a long title. Also you can click here for the TL;DR.
First off; it's my birthday! 🥳
But anyway; I've been working on Leaderboards.GG, which is a WIP site for hosting gaming leaderboards (think SRC). It runs .NET in the back, and so I've got Muhammad Sammy's C# extension running on VSCodium. It's great and all, but the debugger hasn't worked for me for awhile. Whenever I tried to start a debug session, the buttons will show up for a second before disappearing, and the session will end. No error messages at all. I decided to not care about fixing it early on, until a couple days ago where, after talking to a co-developer on the site, I decided to actually try to figure things out. Thus began a half-day slog to fix what I've found is a niche problem with this extension.
I wasted a lot of time googling at first. Finally did what I should've done from the start: look through the extension repo's issues. A priori, the extension uses Samsung's open-source C# debugger, netcoredbg
under the hood. Turns out; the copy of netcoredbg
in the extension isn't the right architecture for M-chip Macs. With that info, this reply by the extension author was the starting point for my solution, but not the exact one. I instead directly replaced the contents of the debugger folder with a separate version of netcoredbg
. I followed the repo's guide for Macs to download and install the latest version from source. And it has to be from source as well, because they don't have official packages for M-chip Macs. They say as much that support is user-contributed and not by the official maintainers. At the cmake
step however, I got hit with:
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
Thank god passing -DCMAKE_POLICY_VERSION_MINIMUM
actually succeeded without issue. I was about to flip (I was already about three hours in this).
Once that was done, I then moved all of the installed files into the extension's debugger folder, ~/.vscode-oss/extensions/muhammad-sammy.csharp-2.50.25-universal/.debugger
. And with that, voilà! The debugger finally works again!
..except that it doesn't when running test cases. That, I have no solution for. Maybe I'll get frustrated enough to look into it someday, but for now I'll stick to Console.WriteLine
s..
TL;DR
If you're on an Apple Silicon (i.e. arm64) Mac:
- Download the latest source for
netcoredbg
(currently 3.1.2-1054) - Follow their guide to install it
- You may need to pass
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
at thecmake
step
- You may need to pass
- Backup the existing debugger folder, just in case
- It's in
~/.vscode-oss/extensions/muhammad-sammy.csharp-2.50.25-universal/.debugger
by default
- It's in
- Move the installed files into the debugger folder
The debugger's still broken on running test cases, though :(