Search code examples
.net-corecentos

load .so file use fullPath fail with dotnet3.1 on centos7


I use dotnetcore 3.1 Pinvoke to call my .so file,but it can't be load.I used myLibraryFullPath to load it.What can i do to load this .so file? i can post image,this is file image


Solution

  • I had resolved this problem.Put the so file in the Program root directory ,and use this code to import what function you want.

    [DllImport("getIdle.so", EntryPoint = "getIdleTime")]
    private static extern IntPtr getIdleTime();