ros2-dotnet / ros2_dotnet

.NET bindings for ROS2
Apache License 2.0
136 stars 54 forks source link

TypeLoadException: Could not resolve type from typeref (expected class System.Reflection.Assembly in assembly System.Runtime) #116

Open jpadillaperez opened 12 months ago

jpadillaperez commented 12 months ago

Hi everyone! First of all, I would like to express my sincere appreciation for the effort put into developing the project. I have been working on it for the past six months, attempting to create custom messages for ROS2 in Hololens 2.

I have been trying to renew the project of ms-iot/ros_msft_mrtk_native by building ROS2 from scratch for Unity and ARM64 for been able of building customized messages for ROS2 in Hololens 2. I have spent quite some time but I don't manage to make it work. The error that I encounter is related to ros2 dotnet and its dependencies, so I hope that I can find some guidance here. After building ros2 dotnet successfully, without any customized message, once I try to use it in Unity. The following dependency error appear:

TypeLoadException: Could not resolve type with token 01000011 from typeref (expected class 'System.Reflection.Assembly' in assembly 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') ROS2.RCLdotnetDelegates..cctor () (at C:/opt/target/src/ros2_dotnet/ros2_dotnet/rcldotnet/RCLdotnet.cs:130)

This error appears in the lines of initialization and spin of ROS2.NET for both, the Unity Editor and the Hololens 2 App

I'm building on Windows 10, currently using .Net 5, Visual Studio 2019 and building for ROS2 Foxy.

hoffmann-stefan commented 10 months ago

Hi @jpadillaperez,

sorry for the late reply, but was busy at work and spare time recently.

Not sure why this broke. But unfortunately I don't have either a working Unity or UWP setup right now, nor do I have any experience for both of them. I don't think I have the time to set this up anytime near either. Sorry I can't really help here right now :(