Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 7.0 compatibility, Failed to find dll "DlibDotNetNative", for processor architecture AMD64 #302

Open
gallianne opened this issue Jun 27, 2023 · 2 comments

Comments

@gallianne
Copy link

Summary of your issue

I got the Following exception at runtime System.Exception: 'Failed to find dll "DlibDotNetNative", for processor architecture AMD64.'
Is there any known limitation on .Net 7.0 ?

Environment

.NET 7.0 on a WPF application running on windows 11 with a x64 build
DlibDotNetNative.dll and DlibDotNetNativeDnn.dll are in [projectFolder]\bin\x64\Debug\net7.0-windows10.0.17763.0\runtimes\win-x64\native and are both x64 dll
DlibDotNet.dll is in [projectFolder]\bin\x64\Debug\net7.0-windows10.0.17763.0

What did you do when you faced the problem?

It crash at runtime as soon as i call a DlibDotNet method

Output:

System.Exception: 'Failed to find dll "DlibDotNetNative", for processor architecture AMD64.'

What did you intend to be?

DlibDotNet seams to work on an empty .NET 7 application but Always crash in my Solution.
I would like know if there is a know limitation with .NET 7.0 x64 build for windows.

Thanks a lot

@Megadino
Copy link

I also faced this issue and found that a path where Dlib searches for native assemblies depends on run conditions.

If I have .NET 6 Core Console app, and run it in Debug mode with VS attached or run as stand-alone from CMD, everything works as expected.

But then I have .NET Core desktop WinForms app, and this is where the fun begins. If I run the app stand-alone, all works and Dlib looks for native Dlls in the folder [projectFolder]\bin\x64\Debug\net7.0-windows10.0.17763.0\runtimes\win-x64\native

If I run that desktop Winforms app from VS with the attached debugger, then suddenly, Dlib looks for native DLLs in the folder
[projectFolder]\bin\x64\Debug\net7.0-windows10.0.17763.0\dll\x64

How did I find that - I used the ProcessMonitor app to track all disk activity of my app and saw that it looks for Dlib native DLLs in that weird '\dll\x64' path.

@gallianne
Copy link
Author

Thanks @Megadino ! It solved my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants