Disabling the NotNull attribute


As of the last few versions or so of Rider, using null-checks in Rider causes an automatic reference to Jetbrains.Annotations and adds the [NotNull] attribute to parameters and fields. This breaks our team coding standards, so I always end up needing to manually remove it. Is there a way to disable this in settings? Toggling every seemingly related setting did nothing.

Comment actions Permalink

Hello Eric,


You can disable addition of [NotNull] attribute by disabling Automatically propagate annotations option located under Settings -> Editor -> Inspection Settings -> Code Annotations


Let me know if this helps.

Comment actions Permalink

Worked perfectly! Thanks!

Comment actions Permalink

Thank you for the update. I'm glad it helped!


If you have any questions in the future, do not hesitate to contact us again.


Please sign in to leave a comment.