How to install all dependent binaries required to execute native C++ DLL/EXE on windowsservercore Docker image

2

I am facing issue while using native C++ DLL into the C# .NET core app on windowsservercore Docker container. Getting following error when try to call exposed API from the native DLL using pInvoke from C# .NET Core application.

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

Problem : my windows docker container (build from windowsservercore base image) has one C# .net core service running .. on the specific POST request.. I need to call function from native C++ DLL, I am calling it using pInvoke. now the problem is the native DLL is not loading because some of its dependencies are missing in the container image.. I tried installing possible VC++ redistributables .. but it does not solve the problem.. so while checking complete dependency tree (using dependency walker) I came to know that some system libs are missing in the windowsservercore base docker image. following is the list of some of missing libs form docker container.

c:\windows\system32\ELSCORE.DLL
c:\windows\system32\DEVMGR.DLL
c:\windows\system32\DCOMP.DLL
c:\windows\system32\DSREG.DLL
c:\windows\system32\SHDOCVW.DLL
c:\windows\system32\COREUICOMPONENTS.DLL
c:\windows\system32\POLICYMANAGER.DLL
c:\windows\system32\OPENGL32.DLL

So my question is, How to solve those system level lib dependencies on container ? I understand that for obvious reasons (minimizing the image size) those libs are excluded from the base windowsservercore docker image. But is there any standard way/installer/package that install missing system libs to my docker image ? or should I go with dirty manually copy all the required libs to system32 folder

PS : This same code works on host machine (windows server 2016) after installing VC++ redistributable, its just that its not working on windowsservercore Docker container (even after installation of mentioned VC++ redistributable).

Thanks, -Harsh

c++
windows
docker
dll
docker-windows

1 Answer

2

For now with the current released windows server docker images you can not execute native binaries which are dependent on above mentioned system libs. For this to work on released windows server docker containers, we have to wait for next windows docker image (with much large footprint and more functionalities available) to be released.


User contributions licensed under CC BY-SA 3.0