CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

ArgumentOutOfRangeException on `DisplayArea.FindAll()` with AOT

Open Marv51 opened this issue 1 year ago • 1 comments

Describe the bug When I enable PublishAOT I am getting an ArgumentOutOfRangeException that originates from this line: var a = DisplayArea.FindAll();.

To Reproduce Just add the provided line to an empty WinUI 3 project, enable Native AOT and execute the line.

Expected behavior It should return a collection of DisplayArea objects. This works without PublishAOT. In the past there were issues with this API (#747) but this is not the same issue.

Version Info Latest (2.1.5, with WinAppSDK 1.6.1, WinSDK 10.0.22621.47)

Additional context ParseGenericTypeName in TypeNameSupport.cs is being called with this partialTypeName: CFlat.WinRT.ReadOnlyListToVectorViewAdapter`2[Windowing.DisplayArea,class Microsoft::UI::Windowing::DisplayArea*] Which has a ` but no <, which leads to an exception in the string parsing in the method.

Marv51 avatar Oct 05 '24 14:10 Marv51