Skip to content

Godot incorrectly uses 32-bit .NET SDK even when 64-bit is installed #105558

Open
@acrsinx

Description

@acrsinx

Tested versions

can be reproduced at v4.2.2.stable.mono.official [15073af]

System information

Godot v4.2.2.stable.mono - Windows 10.0.22000 - Vulkan (Mobile) - integrated Intel(R) Iris(R) Xe Graphics (Intel Corporation; 32.0.101.6078) - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 Threads)

Issue description

Description

When both 32-bit and 64-bit .NET SDKs are installed on Windows, Godot detects the correct 64-bit SDK version (e.g., 8.0.15) but still attempts to use the 32-bit SDK during compilation. When opening any normal C# Godot project, console said:

/root/godot/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs:471 - .NET Sdk not found. The required version is '8.0.15'.
  /root/godot/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs:416 - System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 系统找不到指定的文件。
  File name: 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
     at GodotTools.ProjectEditor.ProjectUtils.Open(String path)
     at GodotTools.GodotSharpEditor.ApplyNecessaryChangesToSolution() in /root/godot/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs:line 416
--- Debug adapter server started ---
--- GDScript language server started on port 6005 ---

(Chinese inside means "System cannot find the specified file.")

Expected Behavior

Godot should prioritize the 64-bit .NET SDK when both architectures are present, especially if the OS is 64-bit.

Actual Behavior

Godot incorrectly selects the 32-bit SDK, leading to build failures.

Environment

  • Godot Version: v4.2.2.stable.mono.official [15073af]
  • OS: Windows 11 x64
  • .NET SDKs or runtimes:
    8.0.15 (x64) at C:\Program Files\dotnet
    8.0.14 (x86) at C:\Program Files (x86)\dotnet (only runtimes)
Godot v4.2.2.stable.mono - Windows 10.0.22000 - Vulkan (Mobile) - integrated Intel(R) Iris(R) Xe Graphics (Intel Corporation; 32.0.101.6078) - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 Threads)

Additional Context

This issue does not occur if only the 64-bit SDK is installed.
Workaround: Manually uninstall the 32-bit SDK forces Godot to use the 64-bit version.

Steps to reproduce

Reproduce

  1. Install both 32-bit and 64-bit .NET SDK (or runtimes):
    8.0.15 (x64) at C:\Program Files\dotnet
    8.0.14 (x86) at C:\Program Files (x86)\dotnet (only runtimes)
  2. Open any C# project with Godot (v4.2.2.stable.mono.official [15073afe3]).
  3. Observe the error logs in Godot output panel

Minimal reproduction project (MRP)

Use this to get a error-able project.

git clone https://gitee.com/acrsinx/1024.git

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions