Forum Discussion
Msix : how to load DLL from other msix package.
Are you modeling the en-us.msix as an optional package or as a language resource pack?
You can only load dlls from optional packages, not language resource packs, if your dll is currently contained in a resource pack then you should move it to be part of the main package or change the resource pack to be an optional package.
If you are already using it as an optional package, then can you try using LoadPackagedLibrary (showed in the sample)?
Hi Andy,
Thanks for reply. I've set en-us.msix as an optional package.
I've switch from LoadLibraryEx() to LoadPackagedLibrary() but still does not working.
If I set en-us.msix as "Framework" and set <PackageDependency> from mainapp.msix then I can load mainappres.dll from mainapp.exe. However the en-us.msix is an option package of mainapp.msix not a "Framework".
Is there other way of I can define appmanifest.xml either mainapp.msix or en-us.msix can load DLL the same way as en-us.msix defined with "Framework".
Thanks for sharing your suggestion.
- Andy LiuNov 02, 2018Former Employee
With regards to loading the mainappres.dll, can you try making the en-us.msix optional package to be in a related set with the mainapp.msix, and also make sure mainappres.dll is in the root of en-us.msix when you are using LoadPackagedLibrary? Related set documentation for working within Visual Studio is here: https://docs.microsoft.com/en-us/windows/uwp/packaging/optional-packages
If you are not using Visual Studio, you can create the related set manually by bundling the mainapp.msix into an .msixbundle, with the AppxBundleManifest.xml containing a pointer to the en-us.msix. The documentation for how to do this is here: https://blogs.msdn.microsoft.com/appinstaller/2017/05/12/tooling-to-create-a-related-set/
Let me know if this works for you.
Andy
- Dooyoul ChungNov 02, 2018Copper Contributor
Thanks Andy,
Now, "Optional package" works as expected. The issue caused converting MSI to MSIX with "Msix Packaging Tool" with defining below Install Location. If I define install location as "C:\Program Files\MsixPrototype" then MSIX generated under [ROOT]\Program Files instead of [ROOT]\VFS\ProgramFilesX64\ which caused problem to loading optional package.
Once change package location under [ROOT]\VFS\ProgramFilesX64\MsixPrototype\mainapp.exe
and "Optional Package" as [ROOT]\VFS\ProgramFielsX64\MsixPrototype\mainappres.dll
all worked well with LoadLibraryEx( ).
Suggestion is remove "Install location" from "MSIX Packaging Tool" UI _or_ adding description to avoid confusion.
Thanks all.
- Dooyoul ChungNov 02, 2018Copper Contributor
Hi Andy,
I've followed Modification package process the same way as "Microsoft Ignite" 9/24/18
https://www.youtube.com/watch?time_continue=1798&v=_wCv31TI_30
from 31:00 -34:30
with Notepad++ but it won't able to load plugin. It seems like working if you have Notepad++ MSI installed but once Notepad++ MSI uninstalled, the Notepad++ that installed with Msix won't able to load plugin.
Any ideas?- jvintzelNov 02, 2018Former Employee
We are investigating a bug in the workflow for modification packages, specifically in the scenario you outlined below.
John.
Program Manager Lead, MSIX