walkerton_R
Posts: 2
Joined: Fri Feb 02, 2018 6:23 pm

mono C# handling external .dll

Mon Feb 12, 2018 1:29 am

On my Windows 10 PC I have written a C# code to control camera. To control the camera I needed to add a reference to a .dll file. When I deploy my application to my raspberry pi I get an error caused by the .dll I added to the reference. I use mono to execute the code. I can compile the code on my raspberry pi by running msbuild myApp.csProj. My question is how do I run this application with the external .dll.

infotron
Posts: 1
Joined: Tue Feb 20, 2018 3:28 pm

Re: mono C# handling external .dll

Tue Feb 20, 2018 3:33 pm

I am having the same problem.

If I understand the article I have referenced below correctly, you have to use a native library in the target platform.
So the answer is to develop your library in Linux...

http://www.mono-project.com/docs/advanced/pinvoke/

User avatar
stephj
Posts: 80
Joined: Thu Jun 21, 2012 1:20 pm
Location: Lancashire, UK

Re: mono C# handling external .dll

Fri Feb 23, 2018 2:31 pm

It all depends on what's in that .dll file. If it contains x86/x64 code that you have just copied over from the Windows 10 machine then it will not work at all. If it was created as a .NET or Mono dll, then it should work, as it contains CLR byte code not native machine language.

pauliunas
Posts: 17
Joined: Mon Feb 26, 2018 7:43 am

Re: mono C# handling external .dll

Tue Feb 27, 2018 9:58 pm

What is in the DLL? Did you write it yourself? As others have said, if it includes native (unmanaged) code, it must be recompiled for ARM. Even if it doesn't, you might be out of luck if it calls some Windows specific APIs.

Return to “Other languages”

Who is online

Users browsing this forum: No registered users and 1 guest