Skip to content

feat: Implement Package.Current.Id.Version for Skia and WASM platforms#21951

Merged
MartinZikmund merged 5 commits intomasterfrom
copilot/implement-display-version-api
Nov 28, 2025
Merged

feat: Implement Package.Current.Id.Version for Skia and WASM platforms#21951
MartinZikmund merged 5 commits intomasterfrom
copilot/implement-display-version-api

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

GitHub Issue: closes #19869

PR Type:

✨ Feature

What is the current behavior? 🤔

Package.Current.Id.Version was not implemented on Skia and WASM targets, returning uninitialized default values.

What is the new behavior? 🚀

Package.Current.Id.Version now returns the application's ApplicationDisplayVersion by reading AssemblyInformationalVersionAttribute from the entry assembly at runtime.

Implementation:

  • Reads AssemblyInformationalVersionAttribute first (set by MSBuild from ApplicationDisplayVersion)
  • Falls back to AssemblyVersion if informational version unavailable
  • Handles version strings with metadata suffixes (e.g., 1.0.0+commitHash)
// Now works on Skia/WASM
var version = Package.Current.Id.Version;
// Returns version from ApplicationDisplayVersion property in csproj

PR Checklist ✅

Please check if your PR fulfills the following requirements:

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 ApplicationDisplayVersion property.

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
    • Triggering command: /usr/bin/curl curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED (dns block)
  • crl.godaddy.com
    • Triggering command: /home/REDACTED/.dotnet/dotnet dotnet restore Uno.Skia.csproj (dns block)
  • ocsp.godaddy.com
    • Triggering command: /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

This section details on the original issue you should resolve

<issue_title>Package.Current.Id.Version should return ApplicationDisplayVersion</issue_title>
<issue_description>### What would you like to be added? 💡

Currently this API is not implemented on most targets. It should return the ApplicationDisplayVersion of the app

Why is this needed? 🤔

No response

Renderer 🎨

  • Skia
  • Native

For which platforms 📱💻🖥️

All platforms 🌍

Anything else we need to know? 💬

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI changed the title [WIP] Add API to return ApplicationDisplayVersion feat: Implement Package.Current.Id.Version for Skia and WASM platforms Nov 25, 2025
Copilot AI requested a review from MartinZikmund November 25, 2025 15:36
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html

@unodevops
Copy link
Contributor

🤖 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

Copilot AI and others added 3 commits November 26, 2025 13:19
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.
@MartinZikmund MartinZikmund force-pushed the copilot/implement-display-version-api branch from 760edad to e57af79 Compare November 26, 2025 12:30
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ MartinZikmund
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@MartinZikmund MartinZikmund marked this pull request as ready for review November 26, 2025 12:30
Copilot AI review requested due to automatic review settings November 26, 2025 12:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Version from AssemblyName.Version during 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

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html

@unodevops
Copy link
Contributor

🤖 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

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21951/docs/index.html

@unodevops
Copy link
Contributor

🤖 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

@nventive-devops
Copy link
Contributor

The build 185148 found UI Test snapshots differences: android-28-net9: 14, android-28-net9-Snap: 36, ios: 6, ios-Snap: 68, skia-linux-screenshots: 59, skia-windows-screenshots: 95, wasm: 124, wasm-automated-net10.0-WinUI-Benchmarks-automated: 0, wasm-automated-net10.0-WinUI-Default-automated: 13, wasm-automated-net10.0-WinUI-RuntimeTests-0: 0, wasm-automated-net10.0-WinUI-RuntimeTests-1: 0, wasm-automated-net10.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net9: 14 changed over 825

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • FlyoutTest_When_NoOverlayInputPassThroughElement_Then_DontPassThrough_woOff_UITests_Shared_Windows_UI_Xaml_Controls_Flyout_Flyout_OverlayInputPassThroughElement
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • WebView_NavigateToAnchor_Initial
  • android-28-net9-Snap: 36 changed over 1077

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • TabView_MUXControlsTestApp_TabViewPage_MUXControlsTestApp_TabViewPage
    • TeachingTip_UITests_Microsoft_UI_Xaml_Controls_TeachingTipTests_TeachingTipPage_UITests_Microsoft_UI_Xaml_Controls_TeachingTipTests_TeachingTipPage
    • CommandBar_Examples_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Examples
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • NavigationView_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage
    • Icons_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground
    • MUX_NumberBox_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • ListView_HorizontalListView_Padding_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListView_Padding
    • MUX_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage
    • Transform_Basics_UITests_Shared_Windows_UI_Xaml_Media_Transform_Basics
    • Scrolling_MUXControlsTestApp_ScrollViewDynamicPage_MUXControlsTestApp_ScrollViewDynamicPage
    • Scrolling_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • UIElement_TransformToVisual_Simple_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Simple
    • WebView_WebView_ChromeClient_Uno_UI_Samples_Content_UITests_WebView_WebView_ChromeClient
    • WebView_WebView_JavascriptInvoke_Uno_UI_Samples_Content_UITests_WebView_WebView_JavascriptInvoke
    • WebView_WebView_WithHeaders_Uno_UI_Samples_Content_UITests_WebView_WebView_WithHeaders
    • Windowing_UITests_Windows_UI_Xaml_WindowTests_Window_Metrics_UITests_Windows_UI_Xaml_WindowTests_Window_Metrics
  • ios: 6 changed over 255

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • ListView_VirtualizePanelAdaptaterIdCache_ListView_VirtualizePanelAdaptaterIdCache
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • TextBox_UpdatedBinding_On_OneWay_Mode_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Bindings
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • ios-Snap: 68 changed over 994

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes_RectangleStretchFill_Uno_UI_Samples_UITests_ImageBrushTestControl_RectangleStretchFill
    • ContentControl_ContentControl_SelectorInheritance_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_SelectorInheritance
    • Default_UITests_Windows_UI_Xaml_Controls_Canvas_Grid_ZIndex_UITests_Windows_UI_Xaml_Controls_Canvas_Grid_ZIndex
    • Image_EmptyImageFixedWidth_Uno_UI_Samples_UITests_ImageTestsControl_EmptyImageFixedWidth
    • ListView_ListView_KeyboardInterception_UITests_Windows_UI_Xaml_Controls_ListView_ListView_KeyboardInterception
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • Microsoft_UI_Composition_UITests_Windows_UI_Composition_VisualTranslationSample_UITests_Windows_UI_Composition_VisualTranslationSample
    • NavigationView_MUXControlsTestApp_NavigationViewMenuItemStretchPage_MUXControlsTestApp_NavigationViewMenuItemStretchPage
    • Microsoft_UI_Xaml_Media_CompositionTarget_Rendering_UITests_Shared_Windows_UI_Xaml_Media_CompositionTargetTests_CompositionTarget_Rendering
    • Brushes_ImageBrushStretch2_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushStretch2
    • Buttons_Custom_Button_With_ContentTemplate_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
    • NavigationView_FluentStyle_NavigationViewSample_SamplesApp_Samples_Microsoft_UI_Xaml_Controls_NavigationViewTests_FluentStyle_FluentStyle_NavigationViewSample
    • NavigationView_MUXControlsTestApp_NavigationViewAnimationPage_MUXControlsTestApp_NavigationViewAnimationPage
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • UIElement_TransformToVisual_Simple_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Simple
  • skia-linux-screenshots: 59 changed over 2306

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ImageSourceUrlMsAppDataScheme.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • EllipsemaskingEllipseGrid.png-dark
    • EllipsemaskingEllipseGrid.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ButtonClippingTestsControl.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • AppWindowPositionAndSize.png
    • DisplayInformation.png
    • AppWindowPositionAndSize.png-dark
    • Buttons.png-dark
    • DropDownButtonPage.png-dark
  • skia-windows-screenshots: 95 changed over 2306

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppWindowPositionAndSize.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ContentPresenter_NativeEmbedding_ZIndex.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • AppWindowPositionAndSize.png-dark
    • ElevatedView_CornerRadius.png-dark
    • ElevatedView_CornerRadius.png
    • Buttons.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png
    • ContentPresenter_NativeEmbedding_Android_FillType.png-dark
    • ContentPresenter_NativeEmbedding_Android_FillType.png
    • ImageIconPage.png-dark
  • wasm: 124 changed over 1058

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Windows_UI_Xaml_Shapes.ShapeControlsPage
    • UITests.Shared.Windows_Devices.Midi.MidiDeviceEnumerationTests
    • UITests.Shared.Windows_Devices.Midi.MidiDeviceOutputTests
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_DataTemplateSelector
    • UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_TextChanging
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_ClipboardMethods
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_Focus_Programmatic
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_ImplicitParentTextBlockStyle
    • GenericApp.Views.Samples.Shared.Content.UITests.GridViewMultipleSelectionMode
    • initial_state
    • UITests.Shared.Windows_UI_Xaml.xBind.xBind
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Shared.Windows_UI_Xaml_Controls.MenuFlyoutTests.MenuFlyoutItem_Click
    • UITests.Shared.Windows_UI_Xaml_Controls.ToggleSwitchControl.ToggleSwitchUnloadReload
    • UITests.Shared.Windows_UI_Xaml_Controls.ToggleSwitchControl.ToggleSwitch_TemplateReuse
    • UITests.Windows_UI_Xaml.FrameworkElementTests.FrameworkElement_Sizes
    • UITests.Windows_UI_Xaml_Controls.GridTestsControl.Grid_ScrollViewer
    • UITests.Windows_UI_Xaml.Performance.Performance_1000ButtonsContinuousRendering
    • UITests.Windows_UI_Xaml_Controls.ImageTests.BitmapImage_vs_SvgImageSource
  • wasm-automated-net10.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net10.0-WinUI-Default-automated: 13 changed over 877

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Default_StrokeThickness_MyPath
    • Default_StrokeThickness_MyPolyline
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Default_StrokeThickness_MyPolygon
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • Default_StrokeThickness_MyLine
    • Default_StrokeThickness_MyRect
    • When_HollowCircle2_UITests_Windows_UI_Input_PointersTests_HitTest_GeometryGroup
    • When_Theme_Changed_No_Crash_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • Default_StrokeThickness_MyEllipse
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
  • wasm-automated-net10.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-2: 0 changed over 1

@MartinZikmund MartinZikmund merged commit d78aaa5 into master Nov 28, 2025
106 checks passed
@MartinZikmund MartinZikmund deleted the copilot/implement-display-version-api branch November 28, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package.Current.Id.Version should return ApplicationDisplayVersion

7 participants