microsoft / CsWinRT

C# language projection for the Windows Runtime
MIT License
547 stars 104 forks source link

TimeSpan parsing failed with NAOT #1696

Closed 4OTbIPE closed 2 months ago

4OTbIPE commented 2 months ago

Describe the bug When using animation in XAML from the Community Toolkit, the application crashes. I suppose in this lines: image Error text: Failed to create a Windows.Foundation.IReference1<TimeSpan> from the text '0:0:0.3'

To Reproduce

  1. Install CommunityToolkit.WinUI.Animations package
  2. Enable PublishAot in csproj
  3. Use lines from the screenshot above

Expected behavior

Application does not crash. animations works correctly

Version Info

CsWinRT: 2.1.0-preview2 WinUI: 1.6-exp2 WinSDK: 10.0.22621.37-preview NET: net8.0-windows10.0.22621 Windows: build 26100

Additional context

manodasanW commented 2 months ago

Should be fixed by https://github.com/microsoft/CsWinRT/pull/1684. Will be publishing updated CsWinRT preview shortly.

manodasanW commented 2 months ago

Published https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/2.1.0-prerelease.240801.1