Skip to content

Add DynamicAccessedMembers attributes to BindingListEx methods - #1087

Merged
dwcullop merged 2 commits into
reactivemarbles:mainfrom
daniel-lerch:aot
May 25, 2026
Merged

Add DynamicAccessedMembers attributes to BindingListEx methods#1087
dwcullop merged 2 commits into
reactivemarbles:mainfrom
daniel-lerch:aot

Conversation

@daniel-lerch

Copy link
Copy Markdown
Contributor

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.

@daniel-lerch

Copy link
Copy Markdown
Contributor Author

Thanks for the hint @JakenVeina! My Visual Studio somehow did not want to run these tests but .NET CLI on Linux worked.

@JakenVeina

Copy link
Copy Markdown
Collaborator

I'm gonna hold off on merging this until we get #1088 worked out, so this can be our guinea pig for auto-publishing a preview release.

@dwcullop
dwcullop merged commit b966943 into reactivemarbles:main May 25, 2026
1 check passed
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Make project AOT compatible

3 participants