5

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?

marcind
  • 52,944
  • 13
  • 125
  • 111
James Ko
  • 32,215
  • 30
  • 128
  • 239
  • Why do you "need to" call AnalysisContext.EnableConcurrentExecution? If you don't, your analyzer will work just the same from a functional point of view (though maybe a bit slower). – Kris Vandermotten Aug 21 '17 at 09:00
  • 1
    @KrisVandermotten Okay, I didn't need to, I wanted to. The question still holds. – James Ko Aug 21 '17 at 16:20
  • Yes, the question still holds indeed. And the accepted answer tells you what you need to know. If (and only if) you are ok with only supporting VS 2015 Update 2 or later, you can call EnableConcurrentExecution. – Kris Vandermotten Aug 25 '17 at 08:04

1 Answers1

14

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)

Jonathon Marolf
  • 2,071
  • 14
  • 16
  • 2
    +1 This is very helpful but is this documented somewhere? I had a hell of a time finding any info on this (I mean, this post is it). – Adam Plocher Aug 15 '17 at 12:45
  • Does it matter which Roslyn version you pick in your analyzer project except that it gives you access to the APIs you want at compile time? Is the Roslyn version used at runtime determined by the host that's using the analyzer? – Rikki Gibson Oct 21 '17 at 18:40
  • Full list: https://learn.microsoft.com/en-us/visualstudio/extensibility/roslyn-version-support – Dribbel Sep 13 '19 at 09:28