I have a .NET 6 service that runs fine on my local Windows 10 machine. When I deploy it on Docker with a multi-stage Dockerfile that uses these images:
mcr.microsoft.com/dotnet/aspnet:6.0-windowsservercore-ltsc2019 AS base
mcr.microsoft.com/dotnet/sdk:6.0 AS build
...it fails to load a native DLL that my service loads (Xbim.Geometry.Engine64 to be exact).
I get the error:
System.IO.FileLoadException: Failed to load Xbim.Geometry.Engine64.dll
---> System.IO.FileNotFoundException: Could not load file or assembly 'Xbim.Geometry.Engine.dll, Culture=neutral, PublicKeyToken=null'. The specified module could not be found.
File name: 'Xbim.Geometry.Engine.dll, Culture=neutral, PublicKeyToken=null'
This DLL exists in my running directory.
I copied the working-fine folder with my binaries from my local machine to the container and got this error! When I copied my failing folder from my container to my local machine - it worked!
What am I doing wrong? Could I be missing something in my container?