.NET Tools Releases ReSharper Platform

ReSharper 2024.1: Improved Handling of Collections, Collection Expressions, and Disposable Resources, New Assembly Diff Tool Window, and More

ReSharper 2024.1 and the latest versions of other JetBrains .NET tools have just been released. 

In this article, we’ll cover the highlights of this major update for ReSharper and touch on the features coming to ReSharper C++. To learn more about our other .NET tools, including dotCover, dotMemory, dotPeek, and dotTrace, check out this separate blog post.

Let’s dive in!

C# Support

More conversions to collection expressions

ReSharper 2024.1 will now suggest converting more code constructions in your source code to collection expressions from C# 12, such as an empty array or the ImmutableArray declaration and initialization.

Collection was modified analysis

The new System.InvalidOperationException: Collection was modified inspection will warn you of potential runtime exceptions when modifying a collection within foreach loops, except when an exit follows the modification, which doesn’t trigger the warning. A quick-fix to immediately resolve this issue is also now available.

Generate | Formatting Members update

The Generate | Formatting Members feature now supports additional types like ISpanFormattable, IUtf8SpanFormattable, and IFormattable, allowing for the automated generation of meaningful ToString() method overrides.

Enhanced support for disposable resources in async methods

  • The [MustDisposeResource] annotation in Resharper 2024.1 ensures the correct disposal of resources from async methods, including those wrapped in Task<IDisposable> and ValueTask<IDisposable>, helping you avoid unintended task disposal.
  • Enhanced code analysis in the 2024.1 version now accurately checks disposal for task-like return values and resources obtained via .ConfigureAwait(...), .AsTask(), or .Result.

Other improvements to C# support include:

  • Updates to the Change Signature refactoring
  • Updates to the Make Static refactoring
  • Support for the protobuf-net library

For more information on these changes, please check out the What’s New in ReSharper 2024.1 page.

Razor support

ReSharper now resolves references for assembly names specified within @addTagHelper and @removeTagHelper directives in your Razor views. As a result, you can now benefit from code completion, the ability to find usages, and ease of code navigation.

ReSharper now considers any unresolved assembly names as errors and highlights them in red to bring them to your attention.


High resource utilization mode in solution-wide analysis

We’re continuing to refine the high resource utilization mode for solution-wide analysis. For this release, we’ve improved the memory allocation profile of code analysis activities to minimize the time spent on garbage collection, speeding up the process and making it more CPU-friendly.

Faster Rename and Move to Another Type refactorings

This update to ReSharper makes renaming elements in your code even faster, leading to performance improvements across multiple features, including Find Usages. The performance of the Move to Another Type refactoring for static members has also been significantly improved when dealing with large classes.

C++ support

ReSharper C++ 2024.1 improves C++20 module support and implements outgoing calls in Call Tracking. Coding assistance enhancements include improvements to the Change Signature refactoring, updated documentation comments support, and more.

Support for outgoing call tracking in ReSharper C++ 2024.1

Learn all about the C++ updates included in the latest release from this blog post.

A new dedicated Assembly Diff tool window

The 2024.1 update introduces the new Assembly Diff tool window to ReSharper. There are a couple of changes that come with it:

  • The ability to compare assemblies, NuGet packages, folders, and .zip archives has been moved from the Assembly Explorer to the Assembly Diff tool window.
  • The Diff mode selector and the Compare and Diff Options buttons have been relocated to the Actions bar of the Assembly Diff tool window.

The decompiler inside ReSharper 2024.1 now also supports the WebCIL packaging format for WebAssemblies

Command Line Tools

Starting with the 2024.1 release, the default output format of InspectCode is SARIF. The XML format will soon be deprecated. Results are still available in XML format in the current version when using the -f="xml" parameter.

Other notable updates

  • Code formatting capabilities of ReSharper 2024.1 have been enhanced with an improved UX/UI for custom naming rules. There’s now also a new formatting setting that allows you to either leave or remove whitespace in blank lines.
  • The standalone versions of dotTrace, dotMemory, and dotCover now support MAUI (desktop only) and .NET macOS applications. Learn more about the newest features in the .NET tools from this dedicated blog post.
  • ReSharper’s extension manager will no longer display incompatible plugins.

For more information on these and other updates in ReSharper 2023, please visit the What’s New in ReSharper page.

You can also review the full list of requests we’ve addressed during this release cycle in our public bug tracker.

You can download the release build from the ReSharper 2024.1 page or install it using the JetBrains Toolbox App.

We appreciate any feedback you might have about the new features and changes introduced in this latest version!

image description