Native dll not loaded in Asp.Net core project but works fine in console app


I am trying to solve an issue where I have a class library that uses a dll(say A) and in turn, that dll(A) uses a 64 bit native dll. I am referencing the class library in core web api application in visual studio. When I call a function from class library that uses the native dll, it throws me error:

DllNotFoundException: Unable to load DLL 'company.Native.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

When I create a .net core console app and refer the same class library and call the same function, it works fine.

So I am trying to find what's there in console app that I am not doing in core application?

or something in core that is preventing loading of that native dll.

I looked at the bin/debug in core application and I can see the native dll there. Also the dll and the native dll that it refers are in same folder.

asked on Stack Overflow Jun 25, 2019 by NetDeveloper • edited Jun 26, 2019 by NetDeveloper

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0