[英]Godot unable to build C# scripts : The reference assemblies for .NETFramework,Version=v4.7 were not found
I started a toy project with the Godot Game engine v3.2.2 using Mono.我使用 Mono 使用 Godot Game 引擎 v3.2.2 开始了一个玩具项目。 I just tried to compile a very simple C# script, and the build fails with the following error thrown in the logs:我只是尝试编译一个非常简单的 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.
Done building project "Bloopers.sln" -- FAILED.完成构建项目“Bloopers.sln”——失败。
I have Mono v.6.12 installed.我安装了 Mono v.6.12。 Any insight into this issue would be greatly appreciated !对这个问题的任何见解将不胜感激! Thanks!!!谢谢!!!
Ok, I just figured it out.好吧,我刚刚想通了。 I have both frameworks installed:我安装了两个框架:
Apparently Godot detects both and gives you an option between the two.显然 Godot 检测到两者并为您提供两者之间的选择。 By default it chooses dotnet core.默认情况下,它选择 dotnet 核心。 Godot at this moment only officially supports Mono. Godot 目前只正式支持 Mono。
To ensure you are using Mono: Editor -> Editor Settings Mono -> Builds Select "MSBuild(Mono)" in the drop down menu.确保您使用的是 Mono: Editor -> Editor Settings Mono -> Builds 在下拉菜单中选择“MSBuild(Mono)”。
Now my game builds.现在我的游戏建立了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.