Godot 无法构建 C# 脚本:找不到 .NETFramework 的参考程序集,Version=v4.7

Godot unable to build C# scripts : The reference assemblies for .NETFramework,Version=v4.7 were not found

我用 Godot 游戏引擎 v3.2.2 使用 Mono 开始了一个玩具项目。 我刚刚尝试编译一个非常简单的 C# 脚本,但构建失败并在日志中抛出以下错误:

Project "Bloopers.sln" (Build target(s)):
Message: Building solution configuration "Debug|Any CPU".
Project "Bloopers.csproj" (default targets):
    /usr/share/dotnet/sdk/3.1.402/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: 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 [/home/mrblack/src/games/godot/godot_v3/lab/first_game_dotnet/Bloopers.csproj]
    MakeDir: Creating directory ".mono/temp/obj/Debug/".
Done building project "Bloopers.csproj" -- FAILED.

完成构建项目“Bloopers.sln”-- 失败。

我安装了 Mono v.6.12。任何对此问题的见解将不胜感激! 谢谢!!!

好的,我刚刚弄明白了。 我安装了两个框架:

  • 单声道
  • dotnet 核心

显然 Godot 检测到两者,并为您提供了两者之间的选择。默认 它选择了 dotnet 核心。 Godot暂时只正式支持Mono

为确保您使用的是 Mono: 编辑器 -> 编辑器设置 单声道 - >构建 Select 下拉菜单中的“MSBuild(Mono)”。

现在我的游戏开始构建了。