UsedImplicitlyAttribute vs PublicAPIAttribute for members that may be used by other user

I'm working on a public library and I'm starting to get a large number of warnings that 'Member X is unused', 'Auto Property can be made get-only', 'Property can be made private' etc. It's becoming rather annoying and I'm starting to use the `JetBrains.Annotations` attributes to hide them. My one question is, should I use UsedImplicitly or PublicAPI to hide the warnings?

1 comment
Comment actions Permalink

Hello,

 

thank you for contacting us.

UsedImplicitly can be used with different flags: ImplicitUseKindFlags и ImplicitUseTargetFlags .
PublicAPI - is a particular case of UsedImplicitly attribute applied with specific flags ( ImplicitUseTargetFlags.WithMembers, ImplicitUseKindFlags. Default).

Please let me know if you have any more questions.

Thank you.

0

Please sign in to leave a comment.