Stop ReSharper from Adding Annotations

后端 未结 1 2063
难免孤独
难免孤独 2021-02-19 04:52

I\'m using ReSharper in my C# projects, and generally I love it. However, it keeps adding annotations to the code when I do certain refactoring actions.

For example, it

相关标签:
1条回答
  • 2021-02-19 05:29

    When you reference the JetBrains.Annotations.dll, the default action for "Check parameter for null" seems to be to use the NotNull attribute (despite adding an "Annotate with 'NotNullAttribute'" option.

    The only workaround that I know is to not reference JetBrains.Annotations.dll.

    Update:

    looking more into this, it seems that there was a suggestion/bug that [NotNull] be added when the annotations dll is included and "Check parameter for null" is requested: http://youtrack.jetbrains.com/issue/RSRP-70350 In case anyone else happens across this and wonders why...

    0 讨论(0)
提交回复
热议问题