MSIX limitations: How to fix “DLL not found” issue
It is commonly known that MSX technology comes with a set of limitations that most of the packagers must deal with, in spite of all its benefits.
To find out more about the benefits of MSIX, check out our MSIX Introduction: A comprehensive 24-chapter guide article.
In this article, we will learn about one of those limitations, the "DLL not found" error message. Let’s see why this error occurs and how you can fix it.
Why do you get a "DLL not found" error message in MSIX?
Win32 applications behave differently when they run inside an MSIX container than when they are natively installed. In some scenarios, the required .dll files needed will not load correctly.
If an application cannot find the required .dll file, it crashes or prompts an error message describing the issue (including the file name of the .dll file).
When an application loads a .dll file at runtime, it uses Windows API calls to search for the .dll file with the provided name in the process’s current working directory (the same folder as the executable) and a few other folders, such as:
- Folders listed in the PATH environment variable
- Folders listed in the “App Paths” registry key (x64 and x86 applications)
For x64 bit applications:
For x86 bit applications:
The App Path registry key is ignored within the MSIX container, and environment variables (including the PATH environment variable) are not supported by default in MSIX. Aside from that, the working directory of the target process is set to the System32 folder by default in MSIX packages.
How to overcome the environment variable and directory limitation in MSIX?
It is very likely that the “DLL not found” issue will be resolved once the environment variables and directory limitations are resolved.If your application installer sets up an environment variable or the application shortcut has a working directory, a first approach to resolving these two MSIX limitations is by injecting the Package Support Framework within your MSIX package.
You can check out The most common MSIX limitations and how to fix them with the Package Support Framework (PSF) and How to Set Up an Environment Variable in MSIX to Directory and File Paths, for more information about these two limitations.
Advanced Installer “DLL Path” fixup to the rescue
Another way to fix your “DLL not found” error is by using the DLL Path predefined fixup in Advanced Installer.
Advanced Installer’s strong PSF integration and its easy-to-use interface allow you to use the DLL Path predefined fixup.
Here’s how it works:
- Go to the “AppCompat” page
- Add a “New DLL Path” fix
- Set the “DLLs Folder“
Once the DLL Path fixup is added, it enhances the search to look into the “DLLs Folder” directory.
Enjoy Advanced Installer’s PSF integration through our 30-day full-featured free trial.
How to find out which DLL is causing the issue?
In some cases, the application simply crashes without displaying a meaningful error message or the name of the.dll file.
If that’s the case, then you can use the “TraceApp” functionality within Advanced Installer to trace the exact MSIX package. If a DLL is identified during the tracing, Advanced Installer will automatically inject the PSF fixup that needs to be applied to your package.
For more information about the “TraceApp” functionality and how to use Process Monitor to trace the root cause of an issue, you can check out our How to debug an MSIX package failure with the Package Support Framework (PSF Trace Fixups) article.
If you find a limitation such as the "DLL not found" error in MSIX, now you know how to fix it. You can take advantage of Advanced Installer's GUI to overcome the “DLL not found” limitation within MSIX packages.
You do not need to worry about injecting the Package Support Framework or configuring the config.json file. Advanced Installer handles everything automatically in the background.
For more helpful content, check out our MSIX articles.
Subscribe to Our Newsletter
Sign up for free and be the first to receive the latest news, videos, exclusive How-Tos, and guides from Advanced Installer.