小能豆

What are the correct version numbers for C#?

c#

What are the correct version numbers for C#? What came out when? Why can’t I find any answers about C# 3.5?

This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.


阅读 162

收藏
2023-12-25

共1个答案

小能豆

C# versions are closely tied to the .NET Framework and Visual Studio releases. Here’s a breakdown of major C# versions along with their corresponding .NET Framework and Visual Studio releases:

  1. C# 1.0:
  2. Released with .NET Framework 1.0.
  3. Visual Studio .NET 2002.
  4. C# 1.2:
  5. A minor update introduced with .NET Framework 1.1.
  6. Visual Studio .NET 2003.
  7. C# 2.0:
  8. Released with .NET Framework 2.0.
  9. Visual Studio 2005.
  10. Notable features: Generics, nullable types, iterators, anonymous methods, and partial classes.
  11. C# 3.0:
  12. Released with .NET Framework 3.0.
  13. Visual Studio 2008.
  14. Notable features: LINQ (Language Integrated Query), anonymous types, extension methods, and implicit typing (var).
  15. C# 4.0:
  16. Released with .NET Framework 4.0.
  17. Visual Studio 2010.
  18. Notable features: Dynamic types, optional parameters, and named arguments.
  19. C# 5.0:
  20. Released with .NET Framework 4.5.
  21. Visual Studio 2012.
  22. Notable features: Async and await keywords for asynchronous programming.
  23. C# 6.0:
  24. Released with .NET Core 1.0 and .NET Framework 4.6.
  25. Visual Studio 2015.
  26. Notable features: Primary constructor, using static, and string interpolation.
  27. C# 7.0:
  28. Released with .NET Core 2.0 and .NET Framework 4.7.
  29. Visual Studio 2017.
  30. Notable features: Tuples, pattern matching, out variables, local functions, and more.
  31. C# 7.1:
  32. Released with .NET Core 2.0.
  33. Visual Studio 2017.
  34. Minor update with features like tuple projection initializers and default literals.
  35. C# 7.2:
    • Released with .NET Core 2.1.
    • Visual Studio 2017.
    • Features include reference semantics with value types, non-trailing named arguments, and more.
  36. C# 7.3:
    • Released with .NET Core 2.1.
    • Visual Studio 2017.
    • Features include tuple equality, tuple comparison, and more.
  37. C# 8.0:
    • Released with .NET Core 3.0.
    • Visual Studio 2019.
    • Notable features: Nullable reference types, asynchronous streams, ranges and indices, default interface methods, and more.

It’s worth noting that C# versions are often associated with the corresponding .NET runtime versions, and the .NET Core and .NET 5/6/7/… unification brings a more streamlined versioning approach. If you are using a specific version of Visual Studio, it usually supports multiple versions of the C# language.

2023-12-25