by the way. The CLR and .net runtime works good at most time. like logic deal or send message to other machine. I can use python to call some method in DLL in .net successfully .So I guess maybe there is other requirement to build
Building .net DLL at Ubuntu and used by python program issue
Hi, I've met some question when I dev my python program at Ubuntu 22.04 LTS. I got some code for C# using .net and I packege them to DLL and used by my program. Most of function are work good, But when I try to use DLL to read and write some files like log.txt or something else, Program crashed and throw some exception. Like below
System.TypeLoadException: Could not resolve type with token 0100002d from typeref (expected class 'System.IO.File' in assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <d636f104d58046fd9b195699bcb1a744>:0
The exception appear when I use System.IO.File or System.IO.StreamWriter or System.IO.StringReader. I guess if was my runtime or my CLR env not fit for Read&write in .net dll or just can not deal with file using like System.IO.File in Linux. I'm new for programming in linux and know less about .net at Linux. I will be very glad if u can remail me. thanks