Skip to content

Add DynamicAccessedMembers attributes to BindingListEx methods#1087

Open
daniel-lerch wants to merge 1 commit into
reactivemarbles:mainfrom
daniel-lerch:aot
Open

Add DynamicAccessedMembers attributes to BindingListEx methods#1087
daniel-lerch wants to merge 1 commit into
reactivemarbles:mainfrom
daniel-lerch:aot

Conversation

@daniel-lerch
Copy link
Copy Markdown

This pull request enables IsAotCompatible and fixes the few remaining warnings (resolves #1086). By enabling this flag, warning newly introduced in future .NET versions should become visible once new target frameworks are being added.

Notes to reviewers:

  1. I removed the duplicate net8.0 target framework because Visual Studio 2026 did not allow me to build the project with duplicate target frameworks.
  2. I used DynamicallyAccessedMemberTypes.All for annotating BindingListEx which is not exactly the same as TypeDescriptor.AllMembersAndInterfaces which is being used by BindingList<T> internally. However, that special value is internal and verbose to replicate in a way compatible with various .NET versions.

@JakenVeina
Copy link
Copy Markdown
Collaborator

So, the failing test is the one that makes sure that any changes to the public API surface go through an extra step of verification. There's 2 text files under DynamicData.Tests/API that track the "verified" version of the API surface, which are what the test compares against to detect changes.

If you're running on Windows, you should be able to run the API test in VS, and when it fails, it'll launch an instance of WinMerge that'll let you merge the changes it detects into the "verified" file. Otherwise, you'll have to diff the generated files against the verified files manually, and marge the changes in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Make project AOT compatible

2 participants