9

Documentation for microsoft.net.compilers package (at https://www.nuget.org/packages/Microsoft.Net.Compilers/) says

.Net Compilers package. Referencing this package will cause the project to be built using the specific version of the C# and Visual Basic compilers contained in the package, as opposed to any system installed version.

... which begs the question: what version of the compiler is in the package?

That same page says that it supports .NET framework 4.5, but that's not the compiler version, is it?

There are several versions of the package. I assume then that different versions of the package may contain different versions of the compiler. Is there a table somewhere that specifies which compiler version is in each package version?

I guess the package contains both c# and vb compilers, but I'm only interested in c#.

steve
  • 807
  • 1
  • 11
  • 25

1 Answers1

17

From https://github.com/dotnet/roslyn/wiki/NuGet-packages:

  • Versions 1.x mean C# 6.0 (Visual Studio 2015 and updates). For instance, 1.3.2 corresponds to the most recent update (update 3) of Visual Studio 2015.
  • Version 2.0 means C# 7.0 (Visual Studio 2017 version 15.0).
  • Version 2.1 is still C# 7.0, but with a couple fixes (Visual Studio 2017 version 15.1).
  • Version 2.2 is still C# 7.0, but with a couple more fixes (Visual Studio 2017 version 15.2).
  • Version 2.3 means C# 7.1 (Visual Studio 2017 version 15.3).
  • Version 2.4 is still C# 7.1 and VB 15.3, but with a couple fixes (Visual Studio 2017 version 15.4).
  • Version 2.6 means C# 7.2 and VB 15.5 (Visual Studio 2017 version 15.5).
  • Version 2.7 means C# 7.2 and VB 15.5, but with a number of fixes (Visual Studio 2017 version 15.6).
  • Version 2.8 means C# 7.3 (Visual Studio 2017 version 15.7)
  • Version 2.9 is still C# 7.3 and VB 15.5, but with more fixes (Visual Studio 2017 version 15.8)
  • Version 2.10 is still C# 7.3 and VB 15.5, but a couple more fixes (Visual Studio 2017 version 15.9)
  • Version 3.0 includes C# 8.0 beta (Visual Studio 2019 version 16.0), but 2.11 was used for preview1.
  • Version 3.1 includes a preview of C# 8.0 (Visual Studio 2019 version 16.1)
  • Version 3.2 includes a preview of C# 8.0 (Visual Studio 2019 version 16.2)
  • Version 3.3 includes C# 8.0 (Visual Studio 2019 version 16.3, .NET Core 3.0)
  • Version 3.4 includes C# 8.0 (Visual Studio 2019 version 16.4, .NET Core 3.1)

For language features, see https://github.com/dotnet/csharplang/blob/master/Language-Version-History.md

James Skemp
  • 7,386
  • 9
  • 58
  • 95
Julien Couvreur
  • 3,615
  • 25
  • 37
  • Care to share the source of this information? It will help in keeping it up to date. – Heretic Monkey Jun 06 '17 at 19:14
  • There is no source that is more authoritative at this point. I'm tracking this [documentation issue](https://github.com/dotnet/roslyn/issues/19659). For now, this is unfortunately tribal knowledge in the compiler/Roslyn team. – Julien Couvreur Jun 06 '17 at 19:24
  • Ah, didn't realize you were on the team! Thanks for the info. – Heretic Monkey Jun 06 '17 at 19:26
  • 4
    Started a wiki page, which I'll link from the NuGet documentation. https://github.com/dotnet/roslyn/wiki/NuGet-packages – Julien Couvreur Jun 06 '17 at 21:31
  • are there any shared version? every time i move from one PC to another, i have to switch Microsoft.Net.Compiler version. – deadManN Oct 15 '19 at 09:37