Could not resolve type with token 01000012 (expected class ... in assembly ...)

494 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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