P-Invoke in .net core with Linux

前端 未结 2 1245
日久生厌
日久生厌 2020-12-06 05:18

Is there way to implement P/Invoke (dllimport) in .NET Core on Linux ?

Example :

I have C++ MyLib.dll compiled with .net framework.

If

2条回答
  •  眼角桃花
    2020-12-06 05:57

    PInvoke is certainly supported (that is how all of the code that interfaces with the OS works), but not in the specific case you listed. You cannot PInvoke to a win32 binary on Linux, unless you have somehow built a function-compatible version of it for Linux yourself. More realistically, you need to find a Linux function from some other system binary which exposes similar functionality, and then use that instead.

提交回复
热议问题