Describe the bug
The windows community toolkit contains the equivalent to this code (see https://github.com/CommunityToolkit/Windows/blob/c532c1128de4fcb6bb0cb6f5f0918e96fbfdcaf4/components/Helpers/src/NetworkHelper/ConnectionInformation.cs#L53-L58)
var profile = NetworkInformation.GetInternetConnectionProfile();
var names = profile.GetNetworkNames();
List<string> networkNames = new();
if (names?.Count > 0)
{
networkNames.AddRange(names);
}
The AddRange() method throws an exception with the message "IDynamicInterfaceCastable is not supported for generic type 'System.Collections.Generic.ICollection`1[System.String]" when used with AOT compilation
To Reproduce
- Use the code snippet above
Expected behavior
Version Info
CsWinRT compiled from staging/AOT branch
Additional context