Skip to content

Exclude UnsafeAccessorAttribute polyfill - #3307

Closed
AArnott wants to merge 1 commit into
dotnet:masterfrom
AArnott:aarnott-fix-issue-3305
Closed

AArnott wants to merge 1 commit into
dotnet:masterfrom
AArnott:aarnott-fix-issue-3305

Conversation

@AArnott

@AArnott AArnott commented Oct 26, 2026 •

Copy link
Copy Markdown

PolySharp currently embeds UnsafeAccessorAttribute in BenchmarkDotNet assemblies targeting older frameworks. This can mislead source generators into emitting code unsupported by the consumer's target framework.

Exclude that attribute from generated types in the main library. The Release netstandard2.0 build succeeds, and reflection confirms the built assembly does not define it.

Fixes #3305

Prevent the polyfilled attribute from appearing in distributed assemblies and confusing source generators for consumers targeting older frameworks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AArnott

AArnott commented Oct 26, 2026

Copy link
Copy Markdown
Author

Closing in favor of #3306

@AArnott AArnott closed this Oct 26, 2026
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.

Polyfill of UnsafeAccessorAttribute misleads and breaks source generators

1 participant