When using dotnet on Linux, should DllImport reference a Windows DLL or Linux libXXX.so

Frank Natoli 71 Reputation points
2021-04-25T18:23:02.45+00:00

Have setup dotnet on Linux / Centos8.
Have compiled simple .NET Core C# HelloWorld with Visual Studio on Windows, transferred .NET Core C# DLL to Linux / Centos8, and can run, see "Hello, world" output.
Now need to have .NET Core C# program call functions in Linux / Centos8 libXXX.so file, which of course is a Linux equivalent of DLL.
Get System.DllNotFoundException: Unable to load shared library.
The referenced libXXX.so file is in the same directory as the .NET Core C# DLL, so there should be no problem finding the libXXX.so.
Question then, is can .NET Core C# DLLs call functions in Linux libXXX.so libraries?
Or must .NET Core C# DLLs call functions in Windows DLLs?
Thanks.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,415 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,307 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful