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

Closed
Marv51 opened this issue Oct 5, 2024 · 5 comments
Closed

ArgumentOutOfRangeException on DisplayArea.FindAll() with AOT #1810

Marv51 opened this issue Oct 5, 2024 · 5 comments
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.

@Marv51
Copy link
Author

Marv51 commented Nov 25, 2024

Would it be the best option for me to open a new issue on microsoft/microsoft-ui-xaml then? Or could this issue be transferred there? Is this already being tracked internally?

@manodasanW
Copy link
Member

I had tracked down where this type name is coming from, I will open an internal issue on the appropriate team.

@Marv51
Copy link
Author

Marv51 commented Nov 25, 2024

@manodasanW Thank you!

@Marv51
Copy link
Author

Marv51 commented Feb 28, 2025

I guess the "appropriate team" fixed something, as it is working for me now.

(WinAppSDK 1.6.5, CsWinRT 2.2, .NET 9.0.2)

@Marv51 Marv51 closed this as completed Feb 28, 2025
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

3 participants