Pythonnet causes Exception has occurred: "TypeLoadException" when running .net dll on linux
Hello, I have a dotnet dll build using dotnet6.0 on Ubuntu 20.04. I could use the dll using C# application. but when I try to test it using python script with pythonnet on Ubuntu 20.04 , I get the following error " Exception has occurred: TypeLoadException Could not load type of field 'ElmosLCC.ElmosLidarController:_updateWatchdog' (37) due to: Could not resolve type with token 0100004a from typeref (expected class 'System.Timers.Timer' in assembly 'System.ComponentModel.TypeConverter, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.ComponentModel.TypeConverter, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Timers.Timer member:(null) at (wrapper managed-to-native) System.RuntimeType.GetFields_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType) at System.RuntimeType.GetFields_internal (System.String name, System.Reflection.BindingFlags bindingAttr, System.RuntimeType+MemberListType listType, System.RuntimeType reflectedType) [0x0001b] in <de882a77e7c14f8ba5d298093dde82b2>:0 at System.RuntimeType.GetField (System.String name, System.Reflection.BindingFlags bindingAttr) [0x00015] in <de882a77e7c14f8ba5d298093dde82b2>:0 at System.Type.GetField (System.String name) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0 at Python.Runtime.ClassManager.CreateClass (System.Type type) [0x00079] in <3972e4befd8f45a1b7c0e96a8f1f659a>:0 at Python.Runtime.ClassManager.GetClass (System.Type type) [0x00015] in <3972e4befd8f45a1b7c0e96a8f1f659a>:0 at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x0008e] in <3972e4befd8f45a1b7c0e96a8f1f659a>:0 at Python.Runtime.ModuleObject.tp_getattro (System.IntPtr ob, System.IntPtr key) [0x00073] in <3972e4befd8f45a1b7c0e96a8f1f659a>:0 " I tested the dll on windows machine with pythonnet and it's working fine. Best Regards Hossam Alzomor [IZB Wolfsburg 2022 | Hall 2 | Booth 2405 | 11 - 13 Oct, 2022 | Wolfsburg]
participants (1)
-
Hossam Alzomor