Skip to content
| Marketplace
Sign in
Visual Studio>Tools>CodeContracs R# Interop
CodeContracs R# Interop

CodeContracs R# Interop

TomEnglert

|
1,258 installs
| (0) | Free
A code fix provider that automates adding corresponding R# attributes for CodeContract annotations.A code fix
Download

Code fixes to automate adding R#'s [NotNull] attributes for the corrseponding Contract.Requires, Contract.Ensures or Contract.Invariant.

This can be useful to have both R# and CodeContract generate (mostly) the same warnings, or to migrate from CodeContracts to R# at all.

screenshot

e.g.

using System.Diagnostics.Contracts;  namespace Test {     class Class     {         void Method(object arg)         {             Contract.Requires(arg != null);         }     } } 

gets

using System.Diagnostics.Contracts; using JetBrains.Annotations;  namespace Test {     class Class     {         void Method([NotNull] object arg)         {             Contract.Requires(arg != null);         }     } } 

It handles the cases arg != null as well as !string.IsNullOrEmpty(arg)

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