Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the latest version of Roslyn my analyzer can target if I support VS2015?

I'm writing a Roslyn diagnostic analyzer that should work on VS2015 and later editions. I want to know the latest version of Microsoft.CodeAnalysis I can use with my project and still support VS2015. I need to use an API that was added in Roslyn 1.2.0 (AnalysisContext.EnableConcurrentExecution), but I think that version of Roslyn isn't included with VS2015 (IIRC, only VS2017 supports C# 7). Does this mean I can't use this API in my analyzer?

like image 846
James Ko Avatar asked Aug 14 '17 16:08

James Ko


People also ask

How do I know what version of Roslyn I have?

You can always just do csc /? , and we'll print the version header.

How do I enable Roslyn?

The simplest way is File -> Preferences -> Settings, from there search for "roslyn" and tick the setting "Enable Roslyn Analyzers". Be sure to save your settings.

What is Roslyn code analysis service?

NET Compiler Platform (Roslyn) Analyzers inspect your C# or Visual Basic code for style, quality, maintainability, design, and other issues. This inspection or analysis happens during design time in all open files. Analyzers are divided into the following groups: Code style analyzers are built into Visual Studio.

How do you install a Roslynator?

You can use Roslynator through the command-line interface or install it on Visual Studio 2022 or Visual Studio code. To install Roslynator on Visual Studio 2022, download it from the Visual Studio Marketplace. To install Roslynator on Visual Studio Code, download it from the Visual Studio Code Marketplace.


1 Answers

Yes, Roslyn 2.3.0 will only work on Visual Studio 2017.3 and newer.

In general the mappings of Roslyn to Visual Studio versions works like this:

Roslyn 1.0.x -> Visual Studio 2015.0 (RTM)

Roslyn 1.1.x -> Visual Studio 2015.1 (Update 1)

Roslyn 1.2.x -> Visual Studio 2015.2 (Update 2)

Roslyn 1.3.x -> Visual Studio 2015.3 (Update 3)

Roslyn 2.0.x -> Visual Studio 2017.0 (RTM)

Roslyn 2.1.x -> Visual Studio 2017.1.x

Roslyn 2.2.x -> Visual Studio 2017.2.x

Roslyn 2.3.x -> Visual Studio 2017.3.x

Roslyn 2.4.x -> Visual Studio 2017.4.x

Roslyn 2.6.x -> Visual Studio 2017.5.x

Roslyn 2.7.x -> Visual Studio 2017.7.x

Roslyn 2.8.x -> Visual Studio 2017.7.x

Roslyn 2.9.x -> Visual Studio 2017.8.x

Roslyn 2.10.x -> Visual Studio 2017.9.x

Roslyn 3.0.x -> Visual Studio 2019.0 (RTM)

like image 72
Jonathon Marolf Avatar answered Oct 29 '22 11:10

Jonathon Marolf