In old mono, there was a command line flag or a environment variable or something you could add so that whenever pinvoke attempted to load a C DLL, it would verbose print every path it checked and every path it checked for every dependency.

I'm running a C# app with dotnet.exe (8.0.301) on Windows 10. I get "System.DllNotFoundException: Unable to load DLL '[redacted]' or one of its dependencies". [redacted].dll is present. How I get more diagnostic output? dotnet.exe -d does not provide it.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/mcc/statuses/114734524088546101 on your instance and quote it. (Note that quoting is not supported in Mastodon.)