-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Runtime.CompilerServiceslinkable-frameworkIssues associated with delivering a linker friendly frameworkIssues associated with delivering a linker friendly framework
Milestone
Description
We've added a few attributes to net5.0 to help with linker analysis. See
- Add DynamicallyAccessedMembersAttribute #33861 - DynamicallyAccessedMembersAttribute
- Add SuppressLinkerWarningAttribute #35339 - UnconditionalSuppressMessageAttribute
- Consider PreserveDependencyAttribute to help linker #30902 - DynamicDependencyAttribute
If a netstandard library needs to add these annotations, it will be forced to cross-compile to net5.0 just so it can add these attributes. And then of course add #if to all the attribute declarations.
We should make these attributes available down-level. They are simple attributes, and don't have dependencies on newer APIs, so they should be able to be supported on netstandard1.0.
However, this would mean shipping a new package.
An alternative to this would be developers would need to declare the internal attributes themselves (but not in net5.0, since that would conflict).
cc @vitek-karas @marek-safar @stephentoub @terrajobst @ericstj
Metadata
Metadata
Assignees
Labels
area-System.Runtime.CompilerServiceslinkable-frameworkIssues associated with delivering a linker friendly frameworkIssues associated with delivering a linker friendly framework