I wrote a small dll to call a 3rd party dll in C++ and my dll and the 3rd party dll are compiled in release mode.
When I use dependenciesGui to to check dependencies, I can see my dll and the 3rd party dll are referencing MSVCP140.dll, VCRUNTIME140.dll and VCRUNTIME140_1.dll. And these dll loads correctly on my machine.
However when I copied the same files to another machine and dependenciesGui shows these dlls are referencing the debug version SVCP140D.dll, VCRUNTIME140D.dll and VCRUNTIME140_1D.dll. and I see the dll load problem "The specified module could not be found. (Exception from HRESULT: 0x8007007E)" when using DllImport in C#.
both machines have Visual c++ redistributable 2015-2022 installed on windows 10
Any hint what happened? Thanks
Edit: It looks like the parent folder need to be called any thing except Debug, and DependciesGui now shows the non-Debug VC dlls. If the parent folder is named Debug, and it then looks for the debug VC dlls.
Edit 2: the root problem was the 3rd party dlls were the debug version. However DependciesGui shows my dll was referencing the debug VC dlls even it was compiled in release build.