Skip to content

Fix NativeAOT WinGet and startup COM paths#5087

Merged
Gabriel Dufresne (GabrielDuf) merged 3 commits into
mainfrom
investigate-winget-aot
Jul 14, 2026
Merged

Fix NativeAOT WinGet and startup COM paths#5087
Gabriel Dufresne (GabrielDuf) merged 3 commits into
mainfrom
investigate-winget-aot

Conversation

@mamoreau-devolutions

@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • enumerate WinGet COM-projected collections by index instead of using unsupported IReadOnlyList<T> enumeration
  • use raw CoCreateInstance plus the CsWinRT projection for standard WinGet activation
  • bypass legacy COM GPU detection and shortcut stamping under NativeAOT, preserving their safe fallbacks

Fixes #5083
Fixes #5085

NativeAOT audit

  • The legacy file-picker project is not referenced by the Avalonia publish graph, so it is not a shipped NativeAOT risk.
  • Start Menu shortcut AUMID stamping is safely skipped until it can be migrated from legacy COM.
  • The DataGrid smooth-scroll reflection hook can be trimmed, falling back to standard scrolling.
  • Avalonia DataGrid AOT warnings cover unused automatic-column generation; all app grids use explicit columns and compiled bindings.

Testing

  • dotnet test UniGetUI.Windows.slnx --verbosity q --nologo /p:Platform=x64
  • Windows x64 NativeAOT publish (Win-x64-NativeAot)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) changed the title Fix WinGet COM collection enumeration in NativeAOT Fix NativeAOT WinGet and startup COM paths Jul 14, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit e417ab5 into main Jul 14, 2026
5 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the investigate-winget-aot branch July 14, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] WinGet source list empty after latest update [BUG] v2026.2.3 - WinGet fails - (Specified cast is not valid.)

2 participants