Good c# setup on Ubuntu 20.04 with VSCode?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By viper161616

I’m running Ubuntu 20.04. To install Godot (mono version) on this OS, you must install mono-complete. I do most of my development in VSCode and would like to use it with Godot. However, the c# plugin for VSCode requires .net core. Installing .net core via sudo snap install dotnet-runtime-31 --classic and creating an alias breaks Godot.

I’ve suppressed the errors from the c# plugin, but is there a way to get Godot to play nice with VSCode? Maybe a way to tell Godot to ignore the dotnet package or vice versa?

Alternately do I really need the c# package? Are there others that work well with Godot?

:bust_in_silhouette: Reply From: rakkarage

this worked for me, before i switched to gdscript
snap works best for vscode or vscode-insiders but for dotnet apt-get is recomended
i think

Thanks for the response! The issue I’m having is when I install it from the snap VSCode works but Godot then breaks. I tried installing it from the package manager but I haven’t been able to get that to work with vscode.

viper161616 | 2020-08-23 12:11

:bust_in_silhouette: Reply From: Trenico

I use Godot C# with the latest version of KDE Neon which is basically Ubuntu 20.04, what I did was

  1. Install mono-devel
  2. Install VSCode direcly from the official .deb package (Flatpak version wasn’t fully working with Godot)
  3. Setup Godot editor’s settings to use VSCode as the external editor.
  4. Install C#, Mono Debug, C# Tools for Godot and godot-tools (probably don’t need this last one) plugins in VSCode.

And it works perfectly. I never needed .net core to work with the C# plugin, that’s weird. There are some tutorials on youtube which worked for me on how to setup vscode for Godot.

Hey thanks for the reply, I’ll give it a shot this weekend!

viper161616 | 2020-08-31 23:30

I did a full fresh install of Ubuntu, followed teh steps but still get the same error:

fail]: OmniSharp.MSBuild.ProjectLoader
        The reference assemblies for .NETFramework,Version=v4.7 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

Similar to before, if I install dotnet I just get a bunch of other errors. I can still build my Godot projects from Godot - but it would be nice to get things working in VSCode as well.

viper161616 | 2020-09-14 02:23

Install C#, Mono Debug, C# Tools for Godot and godot-tools

What steps did you take to do the above?

PoisnFang | 2021-02-23 09:59

:bust_in_silhouette: Reply From: Gustavo Loureiro dos

In VSCode, go to File > Preferences > Settings > Extensions > C# Configuration > Change “Omnisharp: Use Global Mono” (you can search for it if the menu is too long) to “Always”

thanks! worked like a charm.

boruok | 2020-12-28 06:56