![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | GenerationLost |
Hi everyone,
I’ve waited to try out Godot for when C# support is solid and now seems to be the time. Unfortunately I don’t seem to get very far with my setup, as I can’t get .NET or VS Code to really work with Godot.
Currently I’m running Manjaro and I have to admit I’m not the most versed person in the Linux world, I simply prefer it over Windows and so far I’ve been doing fine. That just for a little background info.
So here’s what I did:
- Downloaded Godot from here.
- Started Godot and get the message about missing .NET (I thought I’ve installed it before):
Unable to load .NET runtime, specifically hostfxr.
Attempting to create/edit a project will lead to a crash.
Please install the .NET SKD 6.0 or later from https://dotnet.microsoft.com/en-us/download and restart Godot
- Installed .NET 6 via Microsoft’s scripts.
- Added variables to my .zshrc as described on Microsoft’s page:
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$HOME/.dotnet:$HOME/.dotnet/tools
- Started Godot again, no error message anymore.
- Created a test project, and tried to create a script. Got this message:
Failed to create C# project.
Output is the following:
Godot Engine v4.0.2.stable.mono.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
modules/gltf/register_types.cpp:70 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
modules/mono/glue/runtime_interop.cpp:1303 - .NET Sdk not found. The required version is '6.0.16'.
--- Debug adapter server started ---
--- GDScript language server started ---
New Scene Root
Create Node
modules/mono/glue/runtime_interop.cpp:1303 - System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at GodotTools.ProjectEditor.ProjectGenerator.GenAndSaveGameProject(String dir, String name)
at GodotTools.CsProjOperations.GenerateGameProject(String dir, String name) in /root/godot/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs:line 13
Transient parent has another exclusive child.
Attach Script
I’ve only found a few other posts on the internet where people seemed to have a similar, if not the same issue. Some suggested, the default path of .dotnet, which is /home/user/.dotnet is was trips up Godot and it should be in like /usr/bin/dotnet, but that didn’t make a difference either. I’ve also updated the path variable afterwards mind you and invoking dotnet from shell always gave the proper output.
So what am I missing here?
Another point would be getting VS Code to work. So I’ve got quite a few options here:
- Get VSCodium as flatpak…
- … or build it from AUR
- Get “the real” VS Code from flatpak…
- … or build it from AUR…
- …or download the archive from Microsoft directly.
I didn’t want to touch the AUR but tried the rest, none of them worked. So you can either set VS Code from the dropdown in the settings under Dotnet > Editor, or set an executable as external text editor under Text Editor > External, which I’ve tried as well. No idea where Godot is looking for VS Code and not finding it:
modules/mono/glue/runtime_interop.cpp:1303 - Cannot find code editor: VSCode
editor/plugins/script_editor_plugin.cpp:2227 - Couldn't open script in the overridden external text editor
TL;DR I basically can’t setup Godot with .NET 6 and VS Code properly. Any help on this would really be appreciated. As of now it’s rather frustrating and I can’t find any other pointers online about this.