You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ms-appx URIs with a query string or fragment don't resolve #24448
ms-appx URIs that carry a query string or fragment don't resolve to their asset. StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/logo.png?v=2")) fails on every target.
Each platform builds the lookup path from uri.PathAndQuery and passes it through verbatim:
src/Uno.WinRT/Storage/StorageFile.skia.cs:25
src/Uno.WinRT/Storage/StorageFile.UIKit.cs:21
src/Uno.WinRT/Storage/StorageFile.wasm.cs:24
src/Uno.WinRT/Storage/StorageFile.Android.cs:38
So the code looks for a file literally named logo.png?v=2, which doesn't exist.
Android used to be an accidental exception. Its drawable lookup ran the encoded name through Path.GetFileNameWithoutExtension, and Path.GetExtension("logo.png?v=2") returns .png?v=2, so the entire query was stripped along with the extension and the lookup landed on Assets_logo. The Android asset fallback (assets.Open(path)) still failed. That coincidence no longer holds after #15891, which resolves the drawable resource name directly instead of deriving it by trimming an extension.
Expected behavior
A query string or fragment is not part of an asset's identity, so it should be stripped before the path is resolved, consistently on all targets.
How to reproduce it (as minimally and precisely as possible)
Unverified - worth confirming what WinUI does with a query on ms-appx before settling on the behavior.
Anything else we need to know?
The fix belongs in GetFileFromApplicationUri rather than in AndroidResourceNameEncoder, so that every platform behaves the same. Using uri.AbsolutePath in place of uri.PathAndQuery is the likely shape of it, and it should come with coverage for at least one non-Android target. Raised from review feedback on #15891.
Activity