Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublishAot with Segmented control crash at runtime #536

Closed
3 of 24 tasks
0x7c13 opened this issue Oct 16, 2024 · 3 comments
Closed
3 of 24 tasks

PublishAot with Segmented control crash at runtime #536

0x7c13 opened this issue Oct 16, 2024 · 3 comments
Milestone

Comments

@0x7c13
Copy link

0x7c13 commented Oct 16, 2024

Describe the bug

These are the versions I am using (all up to date)
CommunityToolkit.WinUI.Controls.HeaderedControls" Version="8.1.240916"
CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240916"
CommunityToolkit.WinUI.Controls.RangeSelector" Version="8.1.240916"
CommunityToolkit.WinUI.Controls.Sizers" Version="8.1.240916"
CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916"
CommunityToolkit.WinUI.Controls.Segmented" Version="8.1.240916"
CommunityToolkit.WinUI.Converters" Version="8.1.240916"
CommunityToolkit.WinUI.Animations" Version="8.1.240916"

Microsoft.Windows.CsWinRT" Version="2.1.6"
Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742"
Microsoft.WindowsAppSDK" Version="1.6.240923002"

And I set this in the csproj:
PublishAot->True

For release build, as long as I click on a Page that contains Segmented control, it crashes. Maybe it has something to do with introducing xmlns:controls="using:CommunityToolkit.WinUI.Controls" in the xaml?

The error is very generic (like always:():
Failed to assign to property 'Microsoft.UI.Xaml.ResourceDictionary.Source' because the type 'Windows.Foundation.String' cannot be assigned to the type 'Windows.Foundation.Uri'.

Steps to reproduce

It should be easy to reproduce, just create a new app with PublishAot set to true. Add Segmented control to the home page and run under release mode.

Expected behavior

App should not crash.

Screenshots

No response

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

Windows 11 24H2 (Build 26100)

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 10, version 2104 (Build 20348)
  • Windows 11, version 22H2 (Build 22000)
  • Other (specify)

Other SDK version

<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>     <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> 	<WindowsSdkPackageVersion>10.0.22621.38</WindowsSdkPackageVersion>

Visual Studio Version

2022

Visual Studio Build Number

No response

Device form factor

Desktop

Additional context

No response

Help us help you

No, I'm unable to contribute a solution.

@0x7c13
Copy link
Author

0x7c13 commented Oct 16, 2024

My feeling is that some resource files (used by Segmented) are trimmed as part of the AOT causing the runtime error.

@michael-hawker
Copy link
Member

@0x7c13 can you try the latest main builds from our MainLatest feed? https://aka.ms/wct/wiki/previewpackages

This didn't come up on our audit of controls with AOT we did the other week (nor that we see currently), see CommunityToolkit/Tooling-Windows-Submodule#205

@0x7c13
Copy link
Author

0x7c13 commented Nov 6, 2024

@0x7c13 can you try the latest main builds from our MainLatest feed? https://aka.ms/wct/wiki/previewpackages

This didn't come up on our audit of controls with AOT we did the other week (nor that we see currently), see CommunityToolkit/Tooling-Windows-Submodule#205

Confirmed that MainLatest works for me :)

@michael-hawker michael-hawker moved this to ✅ Done in Toolkit 8.x Nov 6, 2024
@michael-hawker michael-hawker added this to the 8.2 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants