user1857342
user1857342

Reputation: 1

.NET Core Application Fails to Load C++ DLL

I have a .NET core application that loads a DLL written in C++ and calls functions exported from that DLL:

[DllImport("G729DecodeDLL.dll")]

It runs fine when I run it locally on my PC but when I deploy it on a server running Windows Server 2016 I get the following error when calling a function exported from that DLL:

"System.DllNotFoundException: Unable to load DLL 'G729DecodeDLL.dll': This operation is only valid in the context of an app container."

Upvotes: 0

Views: 473

Answers (1)

David Heffernan
David Heffernan

Reputation: 613612

Almost always this error means that the DLL's dependencies are not present on the target machine. Typically this means the C++ runtime that is required by the DLL. Find out what dependencies the DLL has and ensure that they are met on the target machine.

Upvotes: 1

Related Questions