0

I have a C# project in Godot that I've just updated from C# 7 to C# 10 and .NET 6. Everything works fine and I get no errors in VS code but when I try to build the project from the Godot game engine I get the error System.TypeLoadException: Could not resolve type with token 01000012 (expected class ... in assembly ...)

I'm fairly certain that this means my assemblies are out of sync. Basically I have my main project all under the same namespace and then I have a Utilities package under another namespace using a System.Runtime dependency. It's the System.Runtime dependency that is expected in the System.Runtime assembly and the error occurs when I call a method from my Utilities package.

I'm really not sure how to fix this though. I've had a look around and the main response I've seen is to clean your project by removing all obj and bin files and rebuilding which doesn't work for me. Not sure what else to try.

3
  • Are you working with Godot 3 or 4? Commented Nov 2, 2022 at 13:37
  • Godot 3, downgrading from C# 10 back to C# 7 fixed the problem. I guess Godot just isn't compatible with newer .net versions yet Commented Nov 3, 2022 at 18:44
  • Thats the point I was going to make. Godot 3 uses Mono for compiling. And Mono only supports up to C#7 Commented Nov 4, 2022 at 9:02

1 Answer 1

0

C# 10 has dependencies on types present only on .NET 6. For .NET 3, try using C# 8.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.