Mono (Linux, C#): DLL in same folder can not be found (System.DllNotFoundException)

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Mono (Linux, C#): DLL in same folder can not be found (System.DllNotFoundException)



I am trying to run an C# program on my Raspberry Pi 3 using mono. The program starts correctly, but as soon as I reach a point where I use some OpenCV libraries the program error with the following output:


Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. ---> System.DllNotFoundException: opencv_core220
at (wrapper managed-to-native) Emgu.CV.CvInvoke:cvRedirectError (Emgu.CV.CvInvoke/CvErrorCallback,intptr,intptr)
at Emgu.CV.CvInvoke..cctor () [0x00023] in <4f43ef68be294203a100f85f9cebb2b6>:0
--- End of inner exception stack trace ---
at Emgu.CV.Image`2[TColor,TDepth].AllocateData (System.Int32 rows, System.Int32 cols, System.Int32 numberOfChannels) [0x0002e] in <4f43ef68be294203a100f85f9cebb2b6>:0
at Emgu.CV.Image`2[TColor,TDepth].set_Bitmap (System.Drawing.Bitmap value) [0x00050] in <4f43ef68be294203a100f85f9cebb2b6>:0
at Emgu.CV.Image`2[TColor,TDepth]..ctor (System.Drawing.Bitmap bmp) [0x00008] in <4f43ef68be294203a100f85f9cebb2b6>:0
at App.Program.Main (System.String args) [0x00122] in <b44d2f4f9f83495091806ba3e6a1570f>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. ---> System.DllNotFoundException: opencv_core220
at (wrapper managed-to-native) Emgu.CV.CvInvoke:cvRedirectError (Emgu.CV.CvInvoke/CvErrorCallback,intptr,intptr)
at Emgu.CV.CvInvoke..cctor () [0x00023] in <4f43ef68be294203a100f85f9cebb2b6>:0
--- End of inner exception stack trace ---
at Emgu.CV.Image`2[TColor,TDepth].AllocateData (System.Int32 rows, System.Int32 cols, System.Int32 numberOfChannels) [0x0002e] in <4f43ef68be294203a100f85f9cebb2b6>:0
at Emgu.CV.Image`2[TColor,TDepth].set_Bitmap (System.Drawing.Bitmap value) [0x00050] in <4f43ef68be294203a100f85f9cebb2b6>:0
at Emgu.CV.Image`2[TColor,TDepth]..ctor (System.Drawing.Bitmap bmp) [0x00008] in <4f43ef68be294203a100f85f9cebb2b6>:0
at App.Program.Main (System.String args) [0x00122] in <b44d2f4f9f83495091806ba3e6a1570f>:0



The mentioned library "opencv_core220" is a dll located in the same directory as the exe I exececute using mono.
What can I do to fix this problem?
I never worked with mono so far, but I read you can not use dlls on linux, like on windows, but you have to use so-files. But I got no idea how to get them from my dlls.
The program totally works on windows.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

ef2WBuNf,LVvKoDYsC2hvxGpLLxY4T,LP9pWcd7JzFqtlM 6JDMSRqE4g7 hl,5tMnc40np zjs3eKgQh WLse tnK5,A5vJ46
D1XlYk K 5LvnQkLoudeHSU7JqD sXHixT2e6D2

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham