Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Starting in .NET 6, the project templates that ship with the .NET SDK use the latest C# language features. The following language features are used in template-generated code or enabled by default in the project:
Some of the latest C# language features are not supported by previous target frameworks, so you might experience issues in the following scenarios:
.NET SDK 6.0.100
In previous .NET versions, you can change the target framework to a previous version or add an additional version without having to change the C# code created by the project template.
Starting in .NET 6, when you change or add a target framework, you may need to change the C# code generated by the template to avoid using unsupported language features. The project won't build without these changes. The compiler errors and warnings usually guide you on how to change the generated code to make it compatible with new target framework.
This change affects source compatibility.
We want the project templates to be synchronized with the latest language features. The main usage scenario of targeting the latest framework uses the latest C# language features.
If you encounter compile-time errors and warnings when you retarget to an earlier framework version, use that information to guide you in changing the generated code to make it compatible with the target framework you selected.
To avoid compile-time errors when targeting an older framework, follow these suggestions:
dotnet new <templateName> --framework <targetFramework>
.N/A
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Learning path
Build .NET applications with C# - Training
.NET is a free, cross-platform, open source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, and IoT.