Native binaries are not being copied to the output
Closed this issue · 3 comments
I'm developing a .NET 6.0 application for Windows 64-bit.
I have added the StirlingLabs.Assimp.Net Nuget package to the project, and StirlingLabs.assimp.native.xin-x64 is added automatically.
Unfortunately, no native libraries are being copied to the output folder, and calls to Assimp.Net cause "Error loading unmanaged library from path: Z:\MyProject\bin\Debug\runtimes\win-x64\native\assimp.dll"
After adding the native binaries manually to my project, everything works fine.
Hi Lukas, is this an application or library?
- If it's a library, it's natural that it doesn't include the binary; instead it includes the dependency on the NuPkg that contains it.
- If it's an executable, that's very strange.
Thanks for your quick response. The issue has been resolved. What actually happened was this:
It was indeed a library, which was referenced by an executable. The library output did not include the runtime, the executable output did (as expected).
On launching the executable, an exception occured:
Error loading unmanaged library from path: C:\Project\bin\Debug\runtimes\win-x64\native\assimp.dll
The specified module could not be found. (0x8007007E)
This is despite the assimp.dll module existing at the right location C:\Project\bin\Debug\runtimes\win-x64\native\assimp.dll. This was with the nuget package StirlingLabs.assimp.native.win-x64 version 5.2.5. The assimp.dll file creation date was December 1, 2022.
I then upgraded StirlingLabs.assimp.native.win-x64 to version 5.2.5.4, and now the assimp.dll file creation date is April 21, 2023 and it loads correctly. Looks like the problem was caused by using an outdated version of assimp.dll. I can verify that the "module could not be found" error was triggered by the old assimp.dll version by swapping out the assimp.dll (without changing anything else on the build output).
I had the same problem, thank god this resolved issue exists. Also solved it by updating StirlingLabs.assimp.native library.