Skip to content

Add AOT reflection warnings for .NET 6+ methods #4085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ChrisPulman
Copy link
Member

What kind of change does this PR introduce?

update

What is the current behavior?

Some AOT markup is applied to broadly

What is the new behavior?

Added [RequiresDynamicCode] and [RequiresUnreferencedCode] attributes to methods and interfaces that use reflection and are not compatible with AOT environments in .NET 6 or greater. This change improves compatibility and provides clearer warnings for developers targeting AOT scenarios.

What might this PR break?

AOT requirements updated

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

Added [RequiresDynamicCode] and [RequiresUnreferencedCode] attributes to methods and interfaces that use reflection and are not compatible with AOT environments in .NET 6 or greater. This change improves compatibility and provides clearer warnings for developers targeting AOT scenarios.
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.

1 participant