0 votes

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?

in Engine by (12 points)

3 Answers

0 votes

https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

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

by (1,661 points)

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.

+2 votes

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.

by (31 points)

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

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.

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

What steps did you take to do the above?

+2 votes

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"

by (24 points)

thanks! worked like a charm.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.