Replies: 3 comments 3 replies
-
Is the MvCamCtrl.Net dll in that same directory? |
Beta Was this translation helpful? Give feedback.
-
@NinZeige Did you mange to find solution? I have almost the same issue... |
Beta Was this translation helpful? Give feedback.
-
Here's the root problem:
The DLL Search Order differs for packaged apps vs unpackaged apps. The loader has ~18 ways to resolve a DLL for unpackaged apps but only 9 for packaged apps and PATH isn't one of them One option is to put the DLLs in an MSIX Framework package, declare a static dependency ( Another option is to put the DLLs in an MSIX Framework package, install the Framework when you are installed and use the Win11 Dynamic Dependency API at runtime to add the Framework package to your process' package graph. Another option is to explicitly LoadLibrary(absolutefilename) each DLL needed, from the bottom up e.g. |
Beta Was this translation helpful? Give feedback.
-
I'm using WinUI 3 to develop a program that uses the HikRobot camera and need to add a dll to use its SDK
I add dll reference in VS and intelisense can recognize the members in that dll, but it throws
Unable to load DLL xxxx
at the runtimeThe reason for this problem is that HikRobot further references other dll files in PATH, and these files, according to the information I found on MS docs, do not seem to be accessible by the packaged application.
(my code works fine in console/WPF/unpackaged WinUI 3)
I also can't import these further DLLs directly, because they are dlls for C++, vs did not recognize them.
If I set it to unpackaged, it will work fine, but I still wander if I can solve this problem without changing the packaging config.
Error:
Additional Infos:
MvCamCtrl.Net
MvCameraControl.dll
, which inC:\Program Files (x86)\Common Files\MVS\Runtime\Win64_x64
(there are also many other dlls, and someone says they are also been used)Beta Was this translation helpful? Give feedback.
All reactions