How to include unmanaged code (.dll library) in a .NET project and make it work using docker (linux)?

0

I'm working on a .NET project (ASP.net Core 2.0) and I have a very big problem: I included my C++ .dll library into the project, then I use [DllImport("mylibrary.dll")] to mark any external method.

It works fine when I build/deploy the project without docker (I can invoke my dll methods successfully).

When I try to dockerize it everytime I try to invoke any dll method a DllNotFoundException is thrown:

DllNotFoundException: Unable to load DLL 'myLibrary.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I got a look inside the image using the command:

docker run -it --entrypoint bash company/hello-world

my dll library is listed correctly in the image.

Can anyone help me to solve this issue?

Thanks in advance.

c#
c++
docker
dll
dllimport
asked on Stack Overflow Jun 21, 2018 by Osvaldo • edited Jun 21, 2018 by Osvaldo

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0