Building an Uno App for the Microsoft Store

I built my Calcumber app using Uno for to run as Web App and on Windows (and later for more). To bring Calcumber to the Microsoft Store, I was struggeling a lot. Now when I look back, everything looks managable, but when starting new with this topic, it was just walls of issues ahead of me. Therefore, I’d like to share my main learnings here with you. May it be of help for some coders out there!

Happy Coding

— Sam & Calcumber

Main Learnings

You don’t need an expensive code signing certificate for publishing your app via the Microsoft Store.

To register as a developer, you need a private Microsoft account (MSA), you cannot register using a work or school account (AAD, Azure Active Directory, Entra ID, …).

If logging in into the Microsoft developer account from Visual Studio does not work, changing settings make it work.

Your Store package is an unsigned package. You don’t need a key and you will not find it on your Microsoft Partner site.

Visual Studio Package Wizard does not work for Uno Projects with the Windows App SDK target. You build your packages using the msbuild command directly.$

You might also build for the Desktop (Windows, Linux, Mac using Skia) target instead of Windows App SDK. Then the Visual Studio packaging wizards should work.

Ensure your packages are fully self-contained.

Registering as Developer for Microsoft Store

Registering as a developer for Microsoft Store was a quite confusing procedure for me. First, you need to be aware of the two different kinds of Microsoft accounts:

MSA: personal Microsoft account

AAD: Azure Active Directory or Microsoft Entra ID or Work or School Accont

Registering as a developer only works with a personal MSA account, but the account can be later linked with the AAD account.

Registration as a company needs an official company registration document and cost a registration fee of $99 for companies.

Microsoft Learn Article: Steps to open a developer account

Creating an MSIX Package

Uno Articles

Build an unsigned packaged app

Build a signed packaged app

What is an MSIX package?

An MSIX package is a zipped package of all the files needed to run an application. The installation and uninstallation is automatically handeled by Windows. No admin rights are needed and uninstalling is 100% clean. This package format is accapted on the Microsoft store.

Connecting Visual Studio with the Developer Account

Building a package for the store should be easiest by logging into the developer account from Visual Studio. However, this did not work out of the box. I had to change the login configuration:

Tools ➔ Options ➔ Accounts

Add and reauthenticate accounts using:
System Web Browser (not Windows athentication broker)

Login via:

File ➔ Account Settings ➔ Add

Then it worked. Visual Studio can then fill the app details according to the store entry. Probably this could also be done by hand, and there is no key file needed for the store package.

Installing Windows 10 SDK

The Windows 10 SDK might be needed for building the package. And it containt the Windows App Cert Kit, which is recommended to run on the build package before uploading to the store.

I was installing Windows 10 SDK via the Visual Studio Installer, but the Windows App Cert Kit was missing at the end. So then I installed it via the official Installer. Finally, the Windows App Cert Kit is under C:\Program Files (x86)\Windows Kits\10\App Certification Kit\.

Preparing the Uno Manifest

Open Package.appxmanifest in the Desinger view.

Visual Assets Tab: use the generator to fill all necessary icon assets.

Packaging Tab:

Version Number: in the Designer View, you can only fill three part version number 1.0.0, but there is a four part version number 1.0.0.0 needed. Fill it manually in the source view F7.

Publisher: Choose Certificate… ➔ Create a certificate without password

Building the Package

For testing or deploying as direct download, a self-signed MSIX package is needed (unsigned packages cannot be installed).

For uploading to the store, you must build an unsigned package. The store will then sign it. This package you cannot install and test before uploading, so best is to create both packages based on exactly the same source.

Note on Dependencies

Store packages are supposed to be fully self-contained. That means, it does not depend on other packages, so you have to provide packages like .NET9.0 Runtime and WinAppRuntime, even if these are typically installed on Windows and used by many software packages. This makes your MSIX thick but reliable to run.

Theoretically a dependency of the WinAppRuntime could be defined in Package.appxmanifest and Microsoft Store could resolve it. But not for .NET9.0 since this is intendedly not in the store. So Store packages must provide it. Best practice is being fully self-contained.

Until I got it right with the self-contained package, I often got crashes when startin the application. Using the Event Viewer I got the information:

Faulting module name: Microsoft.UI.Xaml.dll

Faulting module name: CoreMessageingXP.dll

So, it is best to stay fully self-contained using in .csproj:

        <!– This includes the .NET runtime and  WinApp runtime –>

        <SelfContained>true</SelfContained>

        <WindowsAppSdkSelfContained>true</WindowsAppSdkSelfContained>

Self-Signed Package

The following build command I was using for publishing CalcumberUnoApp as self-signed test package. Adjust the input and output path and the TargetFramework as needed.

msbuild ./CalcumberUnoApp/CalcumberUnoApp.csproj `

/r `

/p:TargetFramework=net9.0-windows10.0.26100 `

/p:Configuration=Release `

/p:GenerateAppxPackageOnBuild=true `

/p:AppxBundle=Never `

/p:AppxPackageDir="../../Packages/" `

/p:UapAppxPackageBuildMode=Sideloading `

/p:AppxPackageSigningEnabled=true

Options explained:

OptionComment
/rrun nuget restore before
/p:TargetFramework=net9.0-windows10.0.26100 
/p:Configuration=Release 
/p:GenerateAppxPackageOnBuild=truecall the App Packaing targets after compiling
/p:AppxBundle=NeverOnly one architecture specific MSIX (…_x64.msix)
/p:AppxPackageDir=”../../Packages/” `   
/p:UapAppxPackageBuildMode=Sideloadingusing dev certificate
/p:AppxPackageSigningEnabled=trueturns on signing

Content of the target folder

AppName_1.0.0.0_x64Test/ 
AppName_1.0.0.0_x64 msixthe actual packge
AppName_1.0.0.0_x64.certhe certificate to be trusted for installation (Add to trusted people)
AppName_1.0.0.0_x64.msixsymDebug symbol package, needed for crash analytics
Add-AppDevPackage.ps1A PowerShell helper script that installs the test certificate into the current user’s store, and side-loads the MSIX.
Add-AppDevPackage.resources/Belongs to Add-AppDevPackage.ps1
Install.ps1A minimalist PS script that you can run if you don’t need the full interactive experience.
AppName_x64.appinstallerAn App Installer manifest: XML that tells Windows (or Edge) how to fetch and install your MSIX.
index.htmlA simple landing page that Uno generates alongside the AppInstaller. It gives users a one-click link (via the <a href=”*.appinstaller”> tag) to install your MSIX directly from the browser.

Installing

In Windows Explorer, double click the *.cer file. Install the certificate for Local Machine and place it in the Trusted People store.

Install the msix by double clicking.

Unsigned Store Package

For building the unsinged store package, just run the msbuild with different options. Here, the command used for Calcumber:

msbuild ./CalcumberUnoApp/CalcumberUnoApp.csproj `

/r `

/p:TargetFramework=net9.0-windows10.0.26100 `

/p:Configuration=Release `

/p:GenerateAppxPackageOnBuild=true `

/p:AppxBundle=Never `

/p:AppxPackageDir="../../Packages/" `

/p:UapAppxPackageBuildMode=StoreUpload `

/p:AppxPackageSigningEnabled=false

You cannot install the resulting msix. But you can run Windows App Cert Kit on it to see wether everything is right before uploading it to the store.

Store App Registration

App Capabilities:

Even if you just write a Hello World App in Uno that does not need any advanced System API call, Windows Desktop Apps are typically need full trust, especially Uno Apps. So you need to declare this and provide a privacy policy.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top