feat: Implement Package.Current.Id.Version for Skia and WASM platforms#21951
feat: Implement Package.Current.Id.Version for Skia and WASM platforms#21951MartinZikmund merged 5 commits intomasterfrom
Conversation
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21951/wasm-skia-net9/index.html |
Co-authored-by: MartinZikmund <1075116+MartinZikmund@users.noreply.github.com>
Co-authored-by: MartinZikmund <1075116+MartinZikmund@users.noreply.github.com>
Previously the package manifest version was used, which was not aligned with other targets.
760edad to
e57af79
Compare
|
|
There was a problem hiding this comment.
Pull request overview
This pull request implements the Package.Current.Id.Version property for Skia and WASM platforms by reading the assembly version from the entry assembly. The implementation aims to expose the application's version from ApplicationDisplayVersion at runtime.
Key Changes
- Populates
PackageId.VersionfromAssemblyName.Versionduring assembly initialization - Removes deprecated version parsing from Package.appxmanifest XML
- Adds runtime tests for version access on Skia/WASM platforms
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Uno.UWP/ApplicationModel/PackageId.crossruntime.cs | Added using directives for System, System.Reflection, and a SystemVersion alias |
| src/Uno.UWP/ApplicationModel/Package.Other.cs | Sets PackageId.Version from entry assembly's AssemblyName.Version; removes manifest-based version parsing |
| src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Given_PackageId.cs | Adds conditional compilation for platform-specific tests and new test for Skia/WASM version validation |
src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Given_PackageId.cs
Show resolved
Hide resolved
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21951/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21951/wasm-skia-net9/index.html |
|
The build 185148 found UI Test snapshots differences: Details
|
GitHub Issue: closes #19869
PR Type:
✨ Feature
What is the current behavior? 🤔
Package.Current.Id.Versionwas not implemented on Skia and WASM targets, returning uninitialized default values.What is the new behavior? 🚀
Package.Current.Id.Versionnow returns the application'sApplicationDisplayVersionby readingAssemblyInformationalVersionAttributefrom the entry assembly at runtime.Implementation:
AssemblyInformationalVersionAttributefirst (set by MSBuild fromApplicationDisplayVersion)AssemblyVersionif informational version unavailable1.0.0+commitHash)PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️
Android and iOS already use native APIs to retrieve version info. This implementation mirrors that approach for cross-runtime targets by using the standard .NET assembly attributes that MSBuild populates from the
ApplicationDisplayVersionproperty.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms/usr/bin/curl curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED(dns block)crl.godaddy.com/home/REDACTED/.dotnet/dotnet dotnet restore Uno.Skia.csproj(dns block)ocsp.godaddy.com/home/REDACTED/.dotnet/dotnet dotnet restore Uno.Skia.csproj(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Package.Current.Id.Versionshould returnApplicationDisplayVersion#21950💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.