Godot build error - SOLVED

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 8bitbadger

Hey guys I’m using Godot 3.3.1 Stable mono on Artix Linux system, when creating a new project it compiles fine but when adding a new c# file I get this build error

Running: "/usr/bin/msbuild"  "/home/indieronin/GodotExamples/Test/Test.sln" /restore /t:Build "/p:Configuration=Debug" /v:normal "/l:GodotTools.BuildLogger.GodotBuildLogger,/opt/godot-mono-bin/godot/GodotSharp/Tools/GodotTools.BuildLogger.dll;/home/indieronin/.local/share/godot/mono/build_logs/c673e60b87b840cf7ceac6763f368874_Debug" /p:GodotTargetPlatform=x11
Microsoft (R) Build Engine version 16.9.0 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 2021/05/22 3:17:58 PM.
Project "/home/indieronin/GodotExamples/Test/Test.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any CPU".
_GetAllRestoreProjectPathItems:
  Determining projects to restore...
Restore:
  Committing restore...
  Assets file has not changed. Skipping assets file writing. Path: /home/indieronin/GodotExamples/Test/.mono/temp/obj/project.assets.json
  Restored /home/indieronin/GodotExamples/Test/Test.csproj (in 97 ms).
  
  NuGet Config files used:
      /home/indieronin/.config/NuGet/NuGet.Config
  
  Feeds used:
      https://api.nuget.org/v3/index.json
  All projects are up-to-date for restore.
Done Building Project "/home/indieronin/GodotExamples/Test/Test.sln" (Restore target(s)).
Project "/home/indieronin/GodotExamples/Test/Test.sln" on node 1 (Build target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any CPU".
Project "/home/indieronin/GodotExamples/Test/Test.sln" (1:2) is building "/home/indieronin/GodotExamples/Test/Test.csproj" (2:6) on node 1 (default targets).
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2198,5): error MSB3248: Parameter "AssemblyFiles" has invalid value "/usr/lib/mono/4.7.2-api/mscorlib.dll". Could not load file or assembly 'System.Reflection.Metadata, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. [/home/indieronin/GodotExamples/Test/Test.csproj]
Done Building Project "/home/indieronin/GodotExamples/Test/Test.csproj" (default targets) -- FAILED.
Done Building Project "/home/indieronin/GodotExamples/Test/Test.sln" (Build target(s)) -- FAILED.

Build FAILED.

"/home/indieronin/GodotExamples/Test/Test.sln" (Build target) (1:2) ->
"/home/indieronin/GodotExamples/Test/Test.csproj" (default target) (2:6) ->
(ResolveAssemblyReferences target) -> 
  /usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2198,5): error MSB3248: Parameter "AssemblyFiles" has invalid value "/usr/lib/mono/4.7.2-api/mscorlib.dll". Could not load file or assembly 'System.Reflection.Metadata, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. [/home/indieronin/GodotExamples/Test/Test.csproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.01

I have googled for a solution but I’m just not finding it, any assistance would be greatly appreciated.

SOLVED - Selected “dotnet CLI” in the Godot ‘Edit Settings->Mono->Builds->Build Tool’

PS. Thanks to Yaann :slight_smile:

Looks like something about dotNet 4.7.2 not being found or something like that, do you have it installed?
Also, did you change your build settings?

Yaann | 2021-05-22 13:45

Yes dotNet is installed, my build settings (Build Tool) is set to “MSBuild (Mono)”

8bitbadger | 2021-05-22 13:49

I think you can use the Mono setting only if you have Mono installed
Try setting it to dotNet, worked for me

Yaann | 2021-05-22 13:52

I only have a “dotnet CLI” option, I have selected it now and it does build and run thanks!

8bitbadger | 2021-05-22 13:55

A year later, this is still the solution. Thank you!

Otello | 2022-05-21 23:14