简体   繁体   中英

.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."

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM