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

ArgumentOutOfRangeException on DisplayArea.FindAll() with AOT #1810

Open
Marv51 opened this issue Oct 5, 2024 · 1 comment
Open

ArgumentOutOfRangeException on DisplayArea.FindAll() with AOT #1810

Marv51 opened this issue Oct 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Marv51
Copy link

Marv51 commented Oct 5, 2024

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 Marv51 added the bug Something isn't working label Oct 5, 2024
@dongle-the-gadget
Copy link
Contributor

I think the bug itself is in Windows App SDK, since you're supposed to use < and > in parameterized types (see the samples from cppwinrt), but I guess this can be worked around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants