编程语言
首页 > 编程语言> > c# – 当我使用DLLImport时,我应该在哪里放置dll文件?

c# – 当我使用DLLImport时,我应该在哪里放置dll文件?

作者:互联网

我知道在Windows窗体中你只需要将文件放在Debug文件夹中,但似乎它在android的monodev中完全不同.我试过从assets文件夹中放置文件,添加引用路径,从项目设置等设置引用文件夹但我仍然没有运气.我总是得到一个DLLNotFoundException.

另外,下面是导入dll文件的代码

[DllImport("testing.dll", EntryPoint = "Testing_Open", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
 public static extern uint Testing_Open(HINSTANCE hInstance);

解决方法:

你不能在Mono for Android上使用DllImport .dll,因为它是基于Linux的系统,而不是基于Windows的系统.您需要DllImport一个Linux共享库(* .so).

标签:c,android,monodevelop,dllnotfoundexception
来源: https://codeday.me/bug/20190629/1328698.html