Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Resharper Code Contract Nullability
Resharper Code Contract Nullability

Resharper Code Contract Nullability

Bart Koelman

|
3,532 installs
| (0) | Free
Reports diagnostics, helping you to annotate your source tree with (Item)NotNull / (Item)CanBeNull attributes. See also: https://www.jetbrains.com/resharper/help/Code_Analysis__Code_Annotations.html
Download

This Visual Studio analyzer supports you in consequently annotating your codebase with Resharpers nullability attributes. Doing so improves the nullability analysis engine in Resharper, so NullReferenceExceptions at runtime will become something from the past.

Get started

  • Install this extension in Visual Studio 2015/2017 (make sure Resharper v9 or higher is installed).

  • From the NuGet package manager console:

    Install-Package JetBrains.Annotations

  • Rebuild your solution

Alternatively, you can install as a NuGet package for Visual Studio 2015/2017 or for Visual Studio 2013 and lower.

Instead of adding the JetBrains package, you can put the annotation definitions directly in your source code. In that case, it's recommended to set the conditional and/or internal options checked.

To make analysis work over multiple projects in your solution, define the JETBRAINS_ANNOTATIONS conditional compilation symbol in your project properties.

Analyzer in action

Version history

v2.0.2 (2021-03-14)

  • Fixed packaging issue

v2.0.1 (2021-03-14)

  • Fixed handling of user-defined conversion operators

v2.0.0 (2019-03-28)

  • Added conversion of Resharper nullability attributes to C# nullable reference type syntax

v1.0.10 (2019-02-24)

  • Added support for loading external annotations from NuGet cache and from Rider installation directory
  • Graceful recovery from broken cache file

v1.0.9 (2018-05-20)

  • Bugfix: apply fix would reformat entire document
  • Fix all in document/project/solution: 5x faster, no longer uses excessive memory and causes a lot less merge conflicts (resulting in more changes)
  • Enable concurrent execution, if available.

v1.0.8 (2017-05-09)

  • Added support for ValueTask

v1.0.7 (2017-03-12)

  • Support for Visual Studio 2017 and Resharper 2016.3
  • Fixes around caching of external annotations

v1.0.5 (2016-02-29)

  • Configurable reporting on nullable value types
  • Bugfixes in reporting correctness
  • Performance optimalizations

v1.0.4 (2016-01-12)

  • Bugfix in analysis of partially generic type hierarchy
  • Support Resharper installation in 'All Users' mode

v1.0.3 (2016-01-05)

  • Improved support for External Annotation files
  • Fixed a race condition in VS2015 Update1

v1.0.2 (2015-09-21)

  • Bugfixes in deployment, caching and reporting correctness

v1.0.1 (2015-08-27)

  • Added support for [ItemNotNull] and [ItemCanBeNull] on Lazy and Task (new in ReSharper v9.2)

v1.0.0 (2015-08-06)

  • Initial public version
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft