WinUI 3.0 AOT - ListView ArgumentException for any Input List
See the question and my original answer on StackOverflowThere are at least two ways to fix this issue in the .csproj (you can use one or the other or both):
add this in
<PropertyGroup>
XML element<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
add an explicit package reference to the C#/WinRT package (current version is 2.2.0) to an
<ItemGroup>
XML element<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
I'm not sure why you don't get a compilation warning because AOT compilation usually requires unsafe blocks to be enabled. It may be a bug, seems similar to this: https://github.com/microsoft/CsWinRT/issues/1891