# JetBrains.Annotations

> Attributes that make ReSharper's and Rider's code inspections more accurate

Source: https://talira.ai/catalog/jetbrains-annotations-4bsadt90
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / linting](https://talira.ai/categories/developer-tools/linting), [languages / dotnet](https://talira.ai/categories/languages/dotnet)
- Licence: MIT[^1]
- Pricing: Free and open source
- Free tier: yes
- Backed by: [JetBrains](https://talira.ai/orgs/jetbrains.md)

JetBrains.Annotations is a set of .NET attributes that tell JetBrains' .NET IDEs, ReSharper and [Rider](https://talira.ai/catalog/rider-dqj75ezm.md), what they can't infer from code alone, so their inspections give fewer false positives and catch more. NotNull and CanBeNull (and ItemNotNull and ItemCanBeNull for collection items and task results) declare nullability, Pure and MustUseReturnValue flag ignored return values, UsedImplicitly marks members used through reflection so they aren't reported as unused, StringFormatMethod checks format strings against their arguments, and ContractAnnotation states input and output contracts. Other attributes cover regular expressions, value ranges, disposable resources, and the special semantics of ASP.NET MVC, Razor and XAML APIs. It comes from NuGet as a compiled package or a source-code-only package, and the declarations can also be copied into a project from ReSharper's options.

## Links

- GitHub: https://github.com/https://github.com/JetBrains/JetBrains.Annotations
- Docs: https://www.jetbrains.com/help/resharper/Code_Analysis__Code_Annotations.html

## Problems it solves

- ReSharper warns about possible null references that can't happen
- Rider reports members used only through reflection as unused
- declare which of my C# methods can return null so the IDE checks callers

## Features

- nullability attributes (NotNull, CanBeNull)
- Pure and MustUseReturnValue
- UsedImplicitly for reflection
- StringFormatMethod format checks
- ContractAnnotation contracts
- ASP.NET MVC, Razor and XAML attributes
- compiled or source-only NuGet package

## Trust

Overall: 0.27 out of 1.
Signals: maintenance 0.27, adoption 0.35, momentum 0.08, community 0.50, backing 0.30, extensibility 0.00.

- 55 GitHub stars
- 17 contributors
- backed by JetBrains

Warnings:

- last commit 5 months ago

## Related

- Works with [Rider](https://talira.ai/catalog/rider-dqj75ezm.md)

## Sources

[^1]: https://github.com/JetBrains/JetBrains.Annotations/blob/main/license.md (checked 24 Nov 2026)
