CsWinRT
CsWinRT copied to clipboard
System.Collections.Specialized.ReadOnlyList not supported by AOT generator
Describe the bug
System.Collections.Specialized.ReadOnlyList fails to cast to IList and it makes it impossible to raise INotifyCollectionChanged.CollectionChanged event from user code.
Version Info 2.1.1
Additional context Sorry for opening a lot of tickets, I believe that a lot of this stuff is already being tracked internally, but you never know...
No worries on the number of issues being opened. It looks like ReadOnlyList is an internal type within the .NET runtime used for CollectionChanged scenarios. Our AOT source generator isn't able to detect those and make them AOT safe. We have plans on having a fallback mechanism that uses the statically known type which is tracked by #1661.
In the meantime, you might be able to workaround that issue by following the guidance here: https://github.com/microsoft/CsWinRT/blob/master/docs/aot-trimming.md#known-issues-when-publishing-for-aot
Describe the bug
System.Collections.Specialized.ReadOnlyListfails to cast to IList and it makes it impossible to raiseINotifyCollectionChanged.CollectionChangedevent from user code.Version Info 2.1.1
Additional context Sorry for opening a lot of tickets, I believe that a lot of this stuff is already being tracked internally, but you never know...
Isn't readonlylist in the system.collections.generic namespace?
you might be able to workaround that issue by following the guidance here
Yep, managed to workaround the other issues as well.
Isn't readonlylist in the system.collections.generic namespace?
This seems to be a different implementation used only internally 😅