What’s new in C# 14.0
C# 14.0 will be released in November 2025, at the same time as .NET 10.
C# 14.0 is currently in preview:
- Preview 1 (25 Feb 2025)
All right folks, generic attributes are finally a thing in C#! 🥳 You can define one just as you would define any other generic class: And use it like you would use any other attribute: Generic attribute restrictions When applying the attribute, all the generic type arguments must be provided. In other words, the generic…
Code snippets are a great way of improving your productivity because they allow you to define pieces of code which you can later on insert into your projects by using a short alias. Although they’ve been in Visual Studio for quite some time not many people know what they are, what exactly they do and…
A new ClientGuid property, introduced with .NET 8, allows you to uniquely identify dialogs such as the OpenFileDialog and the OpenFolderDialog, with the purpose of storing state – such as window size, position and last used folder – separately per dialog. To benefit from this behavior, configure the ClientGuid of your dialog to a known…
The With…End With statement in VB allows you to execute a series of statements that epeatedly refer to a single object. Thus the statements can use a simplified syntax for accesing members of the object. For example: Is there a C# syntax equivalent? No. There is not. The closest thing to it would be the…
With .NET 8 we are introduced to a new dictionary type which improves the performance of read operations. The catch: you are not allowed to make any changes to the keys and values once the collection is created. This type is particularly useful for collections that are populated on first use and then persisted for…
Note: this command is only available starting with .NET 8. This command cleans up workload packs that might be left over after an .NET SDK or Visual Studio update. It can be useful when encountering issues while managing workloads. dotnet workload clean will clean up orphaned packs resulted from uninstalling .NET SDKs. The command will…