An application that is trying to import unmanaged dlls via
[DllImport("Unmanaged.dll", EntryPoint = "UnmanagedMethod", ExactSpelling = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
and
LoadLibrary("AnotherUnmanaged.dll" )
keeps throwing
HRESULT: 0x8007007E
exceptions.
The import works with absolute paths, i.e. the dlls exist and can be accessed. Since I can't use absolute paths in production, I need to find out which components need to know which additional include paths.
Is there a way to log all the info about which component is trying to find which dlls unter which paths?
The Exception itself should contain the filename of the dll that isn't found, can you try logging that after catching with try{}catch? Otherwise you can try inspecting your own dll with a tool like Dependencywalker or similar wich can find relations in dll's.
Edit: The search paths are the same for default windows search paths (since unmanaged dll's get loaded with a call to LoadLibrary in windows). These are amongst others:
More info about search paths: https://msdn.microsoft.com/en-us/ie/aa297182(v=vs.100)
User contributions licensed under CC BY-SA 3.0