Getting ready

You will need to have Visual Studio 2017 installed on your machine to execute the recipes in this chapter. You can install a free community version of Visual Studio 2017 from https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15.

Additionally, you should have installed the .NET Compiler Platform SDK to get the CodeRefactoring project template. For reference, see the recipe, Creating, debugging, and executing an analyzer project in Visual Studio, in Chapter 1, Writing Diagnostic Analyzers.

By default, the CodeRefactoring project template targets .NET Portable v4.5 and references version 1.0.1 of Microsoft.CodeAnalysis packages. As we intend to use the C# 7.0 syntax, we need to upgrade the CodeAnalysis packages to version 2.0.0 or later, which are based on .NET Standard and hence require the referencing project to be based on .NET standard templates or target .NET Framework v4.6 or higher. For this recipe, we change the project to target .NET Framework v4.6.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset