Forum Discussion

bill_qu's avatar
bill_qu
Copper Contributor
Feb 14, 2025
Solved

The strange problem of C # program calling C++dll

My C # calls C++DLL and runs it directly in VS2022 without any errors. We use LoadLibrary to load DLLs. Packaged as. msix package, after installation, click on the icon of the application to run, so...
  • TIMOTHY_MANGAN's avatar
    Feb 17, 2025

    The most common cause of loadlibrary failure in an MSIX package is that it doesn't know where to look.  For apps that are used to running outside of the package, this is most commonly solved by one of the following:

    1. Add a LoaderSearchOrder extension to the package listing the relative file path of a folder containing the dlls.
    2. Put the dlls either at the root folder of the package, or in the appropriate VFS\SystemX86 and VFS\SystemX64 folders of the package.

Resources