C# 12 arrived in November with .NET 8, bringing several new features—primary constructors, collection expressions, inline arrays, and more—that make it simpler and easier to write more efficient code. Just as we walked through the .NET 8 highlights previously, in this article we’ll take a close look at the key new features in C# 12.
To work with the code examples provided in this article, you should have Visual Studio 2022 installed in your system. If you don’t already have a copy, you can download Visual Studio 2022 here.