Describe the bug 🐞
Description
When using DynamicData in an WinAppSDK application that is compiled natively with AOT, the trimmer emitted the following warnings:
6>/_/src/DynamicData/Binding/BindingListEventsSuspender.cs(21,17): Trim analysis error IL2091: DynamicData.Binding.BindingListEventsSuspender<T>.<>c__DisplayClass1_0.<.ctor>b__0(): 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'System.ComponentModel.BindingList<T>'. The generic parameter 'T' of 'DynamicData.Binding.BindingListEventsSuspender<T>.<>c__DisplayClass1_0' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
6>/_/src/DynamicData/Binding/BindingListEventsSuspender.cs(22,17): Trim analysis error IL2091: DynamicData.Binding.BindingListEventsSuspender<T>.<>c__DisplayClass1_0.<.ctor>b__0(): 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'System.ComponentModel.BindingList<T>'. The generic parameter 'T' of 'DynamicData.Binding.BindingListEventsSuspender<T>.<>c__DisplayClass1_0' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
6>ILLink : Trim analysis error IL2091: DynamicData.Binding.BindingListEventsSuspender<T>.<>c__DisplayClass1_0.list: 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'System.ComponentModel.BindingList<T>'. The generic parameter 'T' of 'DynamicData.Binding.BindingListEventsSuspender<T>.<>c__DisplayClass1_0' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
6>/_/src/DynamicData/Binding/BindingListEventsSuspender.cs(16,9): Trim analysis error IL2091: DynamicData.Binding.BindingListEventsSuspender<T>.BindingListEventsSuspender`1(BindingList<BindingListEventsSuspender<T>.T>): 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'System.ComponentModel.BindingList<T>'. The generic parameter 'T' of 'DynamicData.Binding.BindingListEventsSuspender<T>' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
6>/_/src/DynamicData/Binding/BindingListEventsSuspender.cs(14,5): Trim analysis error IL2091: DynamicData.Binding.BindingListEventsSuspender<T>.BindingListEventsSuspender`1(BindingList<BindingListEventsSuspender<T>.T>): 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'System.ComponentModel.BindingList<T>'. The generic parameter 'T' of 'DynamicData.Binding.BindingListEventsSuspender<T>' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
6>/_/src/DynamicData/Binding/SortAndBind.cs(146,18): Trim analysis error IL2091: DynamicData.Binding.SortAndBind<TObject,TKey>.SortApplicator.Reset(IEnumerable<SortAndBind<TObject,TKey>.SortApplicator.TObject>, Boolean): 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'System.ComponentModel.BindingList<T>'. The generic parameter 'TObject' of 'DynamicData.Binding.SortAndBind<TObject,TKey>.SortApplicator' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
6>/_/src/DynamicData/Binding/SortAndBind.cs(139,13): Trim analysis error IL2091: DynamicData.Binding.SortAndBind<TObject,TKey>.SortApplicator.Reset(IEnumerable<SortAndBind<TObject,TKey>.SortApplicator.TObject>, Boolean): 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'System.ComponentModel.BindingList<T>'. The generic parameter 'TObject' of 'DynamicData.Binding.SortAndBind<TObject,TKey>.SortApplicator' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
I believe these can be eliminated by adding the appropriate attributes to help the trimmer figure out what needs to be kept.
Step to reproduce
- Create a new WinAppSDK application with DynamicData
- Add these to your project file:
<IsAotCompatible>true</IsAotCompatible>
<!-- Show all Trimmer Warnings -->
<TrimmerSingleWarn>false</TrimmerSingleWarn>
- Create a release app package
- You'll observe the above warnings
Reproduction repository
https://github.com/reactivemarbles/DynamicData/
Expected behavior
No trimmer warnings related to DynamicData should be emitted.
Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
DynamicData Version
9.1.1
Additional information ℹ️
No response
Describe the bug 🐞
Description
When using DynamicData in an WinAppSDK application that is compiled natively with AOT, the trimmer emitted the following warnings:
I believe these can be eliminated by adding the appropriate attributes to help the trimmer figure out what needs to be kept.
Step to reproduce
Reproduction repository
https://github.com/reactivemarbles/DynamicData/
Expected behavior
No trimmer warnings related to DynamicData should be emitted.
Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
DynamicData Version
9.1.1
Additional information ℹ️
No response