Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load .NET runtime on Windows 11 #81369

Closed
andristarr opened this issue Sep 6, 2023 · 5 comments
Closed

Failed to load .NET runtime on Windows 11 #81369

andristarr opened this issue Sep 6, 2023 · 5 comments

Comments

@andristarr
Copy link

Godot version

4.1.1

System information

Windows 11

Issue description

I am running on Windows 11 and the csharp version of Godot doesn’t load. Always gives me the error in the title.

I have already installed .net sdk 6, .net runtime 6 and the .net desktop runtime 6 for windows.

I have checked and the path to the dotnet distro is in my path (both system and user), running dotnet —version gives me the 6.x… version correctly.

Steps to reproduce

Start Godot on Windows 11 after having .NET SDK 6 installed.

Minimal reproduction project

Irrelevant. Described in issue description.

@RedworkDE
Copy link
Member

Please post the output of dotnet --info and the Godot console outputs for further diagnosis.

Additionally ensure that the architecture of dotnet matches Godot.

@andristarr
Copy link
Author

This now includes my .NET 7 install as well, I have installed it later while trying to debug.

.NET SDK:
 Version:   7.0.400
 Commit:    73bf45718d

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.400\

Host:
  Version:      7.0.10
  Architecture: x64
  Commit:       a6dbb800a4

.NET SDKs installed:
  6.0.413 [C:\Program Files\dotnet\sdk]
  7.0.400 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  DOTNET_ROOT       [C:\Program Files\dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

As for Godot output:

ERROR: hostfxr_initialize_for_runtime_config failed with code: -2147450733
   at: (modules/mono/mono_gd/gd_mono.cpp:200)

@raulsntos
Copy link
Member

raulsntos commented Sep 10, 2023

The error -2147450733 is InvalidConfigFile (see https://github.com/dotnet/runtime/blob/main/docs/design/features/host-error-codes.md) and it means:

The .runtimeconfig.json file is invalid. The reasons for this failure can be among these:

  • Failure to read from the file
  • Invalid JSON
  • Invalid value for a property (for example number for property which requires a string)
  • Missing required property
  • Other inconsistencies (for example rollForward and applyPatches are not allowed to be specified in the same config file)
  • Any of the above failures reading the .runtimecofig.dev.json file
  • Self-contained .runtimeconfig.json used in hostfxr_initialize_for_runtime_config. Note that missing .runtimconfig.json is not an error (means self-contained app). This error code is also used when there is a problem reading the CLSID map file in comhost.

Make sure you have extracted the GodotSharp directory next to the Godot binary. If this was the issue, 4.2 will provide a better message (see #80212).

@scotmcp
Copy link
Contributor

scotmcp commented Oct 24, 2023

This really needs to be documented somewhere clearly AND the error message should be updated saying the folder and it's components are missing. This is a big deal !!!

I was having the same issue and spent HOURS, installing, uninstalling, checking environment variables....

@raulsntos
Copy link
Member

@raulsntos raulsntos added this to the 4.2 milestone Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants