Visual Studio Code, Flatpak, and C#: A Guide
01 July 2021

It took me way too long to figure this out, so I figured I’d write a concise tutorial for anyone else who wants to do C# development using Visual Studio Code installed via flatpak.

SDK Installation

You’ll need to install two SDK extensions:

Flatpak Configuration

Two environment variables need to be set for Visual Studio Code to find the .NET SDK. You can use flatpak override --env VARIABLE=VALUE com.visualstudio.code or, if you’d prefer a GUI, use the Flatseal app.

The variables are:

Visual Studio Code Configuration

Next, restart Visual Studio Code and install the C# extension. Go to the Extensions pane on the left (the little building blocks icon), search “C#”, and install the official extension by Microsoft.

Then go to File -> Preferences -> Settings, search “Mono Path”, and click “Edit in settings.json”. Set it to /usr/lib/sdk/mono6. Then go back to the Settings tab and set “Use Global Mono” to “always”.

That should do it! You might need to restart OmniSharp or Visual Studio Code first, but the C#/.NET tools should work now. Hopefully this process will become easier in the future.

You can also support my work on Patreon.


Next

Finishing GNOME Builder's Mobile Device Support

Recently I've been working on libshumate, the new maps library for GTK 4. I used my PinePhone to test the feature, so I needed a way to quickly build libshumate and run it on the phone.

Previous

Ok, but WHY is cryptocurrency so bad for the environment?

Cryptocurrency and especially NFTs (like “crypto art”) are the trendy new thing to talk about right now, and it makes sense: their power to change the world is tremendous. Of course, by “the world” I mean its climate, and I didn’t say it was a positive change.