Missplaced libraries? (Can't find DlibDotNetNative.dll and DlibDotNetNativeDnn.dll)
ADD-eNavarro opened this issue · 3 comments
First things first, thank you very much for your hard work, Takeuchi-san.
Summary of your issue
In VisualStudio 2019 - New project -Console (.NET Core 3.1), I:
- Add NuGet package DlibDotNet
- Change Configuration Manager to Debug x64 (since DlibDotNet won't work with Any-CPU)
- Replace the "hello world" line with: "using (var ffd = Dlib.GetFrontalFaceDetector()){}" (of course I add the "using DlibDotNet" too)
- Hit run and get this message:
"Exception thrown: 'System.Exception' in DlibDotNetCore.dll ("Failed to find dll "DlibDotNetNative", for processor architecture AMD64.")
Environment
Windows Server 2019 Standard, with Intel Xeon processor (ES-2690 v3)
What did you do when you faced the problem?
After some research, I found that the path to DlibDotNetNative and DlibDotNetNativeDnn seem to be hard-coded inside DlibDotNet. I go to [project]/bin/x64/Debug/netcoreapp3.1/ , copy both .dll, manually create there /dll/x64 and paste both libraries there, and the code starts working flawlessly.
What did you intend to be?
I guess DlibDotNet should work straight out of the box.
@ADD-eNavarro
I can not reproduce your issue.
- Create solution file by
dotnet new sln
- Create new console project by
dotnet new console
- Open sln
- Add csproj
- Change target framework from 5.0 to 3.1
- Change configuration like the following. It does not matter solution configuration and we must take care of platform
- Build
- All DlibDotNet binaries are copied automatically
- Works fine
Awesome! It totally works!
So, if I have understood correctly, the "solution" field in Configuration Manager is irrelevant, we only have to be sure to set "platform" to x64 both in Debug and Release, right?
Then, does the check on "build" column actually do something? Sorry, I'm not all that familiar with VS.
@ADD-eNavarro
Yes, solution field is what it make easy to understand build configuration.
So You cam remove Any CPU solution from solution configuration because Any CPU does not work.