I'm a bit confused about calling Calling UWP APIs from a desktop app. The last sentence of the first paragraph of this link states:
a WPF, Windows Forms, or Win32 app cannot call UWP API unless the app is packaged in an MSIX package.
Using VS2019
I have desktop-bridged
my WPF app (developed in VS2019
). This process created a folder (under ...\AppPackages
folder) whose contents are shown below. Double clicking the .appxbundle
from this folder, I can successfully sideload the app on my Windows 10
(and it gives me the option to upload to upload/publish to Microsoft Store
as well):
Question: After satisfying some other requirement, can this app now call UWP APIs
? As noted from the above link, the app needs to be packaged in an MSIX package. And I don't see any MSIX
file in the image below:
Yes. There is no important difference between an APPX and an MSIX package, or whether you have packaged your application using the desktop bridge, a Windows Application Packaging project
or manually using MakeAppx.exe
.
The package file extension is .msix
(or .msixbundle
if you are creating a bundle) if the target version is set to 1809/October 2018 Update/Build 17763/RS5 or later. Otherwise it's .appx
.
Both APPX and MSIX packages are installed and can be used the exact same way.