What’s New In .Net 6
Today, I would like to talk about What’s new in .Net 6. As you know, before .Net 5, we have two sides of .net framework versions. One is called Asp.Net Framework and the other is .Net Core. But since .Net 5, the .net frameworks merged into one.
Lets have a look at to new changes in .Net 6. Firstly, Startup file does not exists in .Net 6. As you knew, startup file was used for configuring the applications’ properties such as https, services and etc. Instead of that, you will configure your service settings and middleware in Program.cs file. You will write your code in Program.cs with default Top Level Statement property in .Net 6. That means you don’t need any main function code block to run your program.
We were using IHostBuilder class in order to create builder class and run our web applications. In .Net6 we will use WebApplication components to create builder classes and initialize and run our wep apps. At the same time we use this builder class to add services and middlewares like cors etc.
At the end, I want to add one more info about ports. Before .Net 6 the default port was 5000 and 5001. In .Net 6 this port usually changes. We will continue to talk about .Net 6 in our next posts. Don’t hesitate to ask me any question about programming. Take care yourself and have a healthy day.
You may like to see one of my post about caching. How To Do Caching In Asp.Net MVC
Recent Comments