Guide: How to build MSIX for Microsoft Store (WASDK 1.3) #8472
omikhailov
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Have you checked that the publish profiles are present in the Properties\PublishProfiles folder? They are included in the .csproj file and should set properties like SelfContained and RuntimeIdentifier to the correct settings. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Congratulate me, I just submitted my first WinUI 3 app to the store. So far, the technology makes a contradictory impression, and the most negative contribution to this assessment is made by the MSIX package assembling stage.
At the moment, Visual Studio does not make valid MSIX packages. Well, you can click Package and Publish -> Create App Packages just like you used to do before for UWP apps, but if you submit generated packages, they will fail certification in the Microsoft Store.
Problem is that WinUI 3 app depends on the Windows App SDK Runtime and .Net 6 Runtime, but Visual Studio does not handle these dependencies correctly.
The first one is easy to fix, because Windows App SDK is available in the Microsoft Store as framework package and all you need is just to add a reference to that package in your Package.appxmanifest:
Looks simply, but I spent hours looking up the name, publisher and version for the package - it is just not documented. If in the future you need to do something similar, open a PowerShell and use following command to search for framework packages installed on your machine:
Get-AppxPackage | Where-Object IsFramework
Unlike the App SDK, .Net 6 Runtime is not published in the Store and Microsoft does not preinstall it with Windows, So, if you will publish your app now, it will show an ugly dialog box asking users to install .Net on the first launch. And that's not all, Microsoft Store team will reject your submission because they have a rule claiming that if your app behaves this way, you must add a notice about such dependencies in the first two lines of the app description. Like, "Hey, this is MyCoolAppName that requires .Net SDK version 6.666 dot zero five six seven... Please don't be afraid to download it".
To do not spoil the user experience, you have to include whole .Net 6 runtime into your package. It's size will increase from 9 megabytes to 40, and Microsoft Store will report that your app requires almost 100 megabytes on the disk, but there is no other way, unfortunatelly.
So, open .csproj file of your app and add options for self-contained app:
Now, if you will try to package the app, Visual Studio may fail with error related to platforms mismatch or something like that. I think that in my case it happened because I had more than one project in a solution, but it could be also an issue in the "Blank App, Packaged (WinUI 3 Desktop)" template itself. Anyway, if it will happen to you, add also following sections into your .csproj file:
Perhaps, you understood an idea - since Visual Studio cannot match platforms and runtime identifiers, you have to map them manually for all platforms you are going to target.
In addition, open Configuration Manager and check that all your projects have the same targets. In my case, a library project had only "Any CPU" configuration available, so I manually edited .sln file to add them:
Finally! Valid MSIX package and the cherished letter from Microsoft
Beta Was this translation helpful? Give feedback.
All reactions