With .NET 6.0 and beyond, there will just be one version of .NET and it's just. NET.
Breaking changes,
If you are going to update the legacy project to .Net 6, don't forget to take a look at the breaking changes
(I am going to descript it later, I have not much time to work on it now. updating below)
New features
Console template
I was surprised when I first time create a console project with.net 6, it is much cleaner and simple
See how is a hello world
Console.WriteLine("Hello, World!");
No need a main method, namespace, or class like the previous.
So what happens here:
Top-level Statements: This feature already exists in C# 9, but here it is utilized for templates.
Global Usings: C# 10 introduces the keyword global. Using this keyword, you are able to define global using for the whole project in a separate file which will contain these imports.
Implicit using directives: This feature forces the compiler to automatically import a set of uses based on the project type. In essence, for each project type, an implicit set of global using is defined, so it doesn’t need to be explicitly stated in each file.
Web app and Web MVC template
If you are a NodeJs developer, you will not be surprised when u see it, Yes, it looks like a NodeJs project. I liked it. Same as Web MVC template
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.MapGet("/", () => "Hello World!");
app.Run();
(.... more .....)