AymericFraise
Iis express is unable to load a native dll
Hello everyone, i have been stuck on this issue for a bit : i was successfully using the package OpenCvSharp4 in a cli app, but when integrating it in an iisexpress-hosted app (.NET 4.8), the code fails with the error "DllNotFoundException : unable to load the DLL 'OpenCvSharpExtern'".
I can find the OpenCvSharpExtern dll in the bin\dll\x64\ folder so i am guessing that somehow iisexpress is not looking there.
I tried moving the dll into the bin folder and adding the dll as a reference through the visual studio gui and through the csproj, but none of those worked.
I think this may be related to the fact that the package is actually two packages, one for managed code and another for windows specific code (OpenCvSharp4.runtime.win), maybe i need to do something specific for unmanaged dlls ?
Hopefully this rings a bell for someone, i'd be grateful for any help
Edit : Following this stackoverflow post https://stackoverflow.com/a/52152079/11378690 i disabled shadow copying in the web.config and the problematic code worked ! This doesn't look ideal though so if someone has a cleaner solution i'd be happy to hear it
1 replies