Search code examples
c#fileuwpstoragewinui

How should I handle storage in a WinUI 3 App that is both packaged and unpackaged?


so I have a WinUi 3 app that is right now developed in a packaged format (MSIX). However, shipping the app outside of the MS Store in that format is quite annoying (specifically the signing and sideloading.) Every user has to first trust my self-signed certificate and then install the app.

I would like to publish the app as an unpackaged version as well, but the Windows.Storage API is not supported in unpackaged apps due to package identity missing.

See:

https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-supported-api https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-packaged-apps

I also tried this, but it doesn't seem to work: https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/tutorial-unpackaged-deployment?tabs=csharp

Any suggestions on how to handle this, or what API to use?

Thanks in advance!


Solution

  • It is recommended that you use System.IO.File to handle storage in unpackaged WinUi3 app. It is supported in WinUI3 unpackaged project.