ReSharper 2017.2 Help

Get assistance in migrating to new C# features

As new versions of C# come out, it’s only natural to want to update your code to take advantage of the latest syntactic features. Luckily, ReSharper is there to help you update your code automatically.

Let's take as an example one of the C# 6.0's best loved features - conditional access expressions. First thing to note is that ReSharper gently points at possibilities to use new language features right in the editor:

ReSharper helps implement new C# features

As usual, pressing Alt+Enter on the highlighted code brings up a quick-fix that helps you make use of the new language feature:

ReSharper helps implement new C# features

After applying the fix, the method is transformed as follows:

public int GetNickNameLength(Person person) { return person?.Nickname.Length ?? 0; }

The important thing to remember here is that if you don't like some of the new language features, you can easily tell ReSharper not to bother you about it:

ReSharper helps implement new C# features

Of course, you can find language usage opportunities in the desired scope up to the whole solution:

ReSharper helps implement new C# features

Additionally, you can use the fix in scope feature to implement some of the new language features in one go in the whole project:

ReSharper helps implement new C# features

... or in the entire solution:

ReSharper helps implement new C# features
Last modified: 12 October 2017

See Also