WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

ApplicationData API not working for unpackaged WinAppSDK App #22034

@Illustar0

Description

@Illustar0

Current behavior 🐛

When attempting to access Windows.Storage.ApplicationData APIs (e.g., ApplicationData.Current.LocalFolder) within a WinAppSDK project running in Unpackaged mode, the application crashes immediately.

The following exception is thrown: System.InvalidOperationException: Operation is not valid due to the current state of the object.

Expected behavior 🎯

The application should handle the missing Package Identity gracefully. Ideally, Uno Platform should abstract this difference and fallback to a standard local file path, or throw a more descriptive exception indicating that ApplicationData is not supported in Unpackaged mode without a Sparse Package.

How to reproduce it (as minimally and precisely as possible) 🔬

Adding any ApplicationData API code to any WinAppSDK project and running it as unpackaged results in the error: Operation is not valid due to the current state of the object.

Workaround 🛠️

N/A

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

Windows App SDK

Uno.Sdk version (and other relevant versions) 📦

6.4.42

IDE version 🧑‍💻

Rider 2025.3.0.3

Anything else we need to know? 💬

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.triage/untriagedIndicates an issue requires triaging or verification

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions