What’s New In .Net 5?
Tags: dotnet
Published: 2020-10-05 14:32:55

There are many changes in the software development fundamentals in the last few years. The developers need to work cross-platform and open source development strategies with faster speed and also they want to integrate the old applications with the new technologies easily. The .NET framework came with a new version ASP.NET 5 to fulfill the requirements.

As compared to previous versions, it includes many new features like support of cloud based, cross platform and open source application development, modularity, faster development cycle and  freedom to choose the programming tools. ASP.NET has compact components with negligible overhead and due to this, developers can feel flexibility while constructing their applications. Let us see the new features of .Net 5 in detail.

#New Features Of .Net 5-
**1. Combination Of MVC, Web API, And Web Pages In Single Programming Model-**
With the new version ASP.NET, MVC, Web API and Web pages are packed into a one framework called MVC 6. This approach removes duplication from the framework and makes it simpler for developers to build applications. So, there is no need to write different code whether you are in MVC, Web API or Web pages context.

**2. Flexible And Cross-Platform Runtime-**
ASP.NET 5 has three different K-runtime environments. Full .NET CLR, Core CLRR (for Windows) and cross-platform CLR (for Mac and Linux). You can choose any of three as per your requirements.

Full .NET CLR- It is a default runtime. If you want the previous application to be compatible with ASP.NET 5, it is a better choice as it provides a complete API set.
Core CLR (Cloud-Optimized CLR)- It is a modular runtime. This CLR allows you to choose and include just the features we need in our application. These features are being included as NuGet packages. This way our application depends just on the necessary features. The Core CLR is around 11 megabytes in comparison with the full .NET CLR which is 200 megabytes. Every component is separately updated hence rapidly as it has its own schedule. Different versions of Core CLR can be run next side-by-side and can be deployed with your application.
Cross-Platform CLR- The cross-platform CLR allows you to develop and run apps on devices running on Mac and Linux operating systems. Mono community can be used for cross-platform development. A web worker called kestrel will be used for Mac and Linux that is built on libuv in ASP.NET 5.

**3. Open-Source-**
.NET will be open source and using its principal it will allow us to run applications on different operating systems. The source code for ASP.NET 5 is hosted on GitHub, within the .NET foundation org.

**4. Ability To Self-host Or Host On IIS-**
ASP.NET 5 gives the adaptability to host your application on IIS or self-host it in your own process. When you build the application focusing on the Core CLR, you can deploy it with each dependency bundled within the deployment package. Thus, your application and its dependencies are completely self-contained and independent of system installation of .NET. This new ability gives you the opportunity to host your application on any device or hosting platform. You just need to deploy your project to that host.

**5. Modularity-**
It is one of the major features of ASP.NET 5. With the previous versions of .NET; to run our application the whole .NET Framework was required to install. It needs more storage on disk. It can cause more problems when we need to run applications in different .NET versions than the one in which they were developed. It depends on features organized as packages. So, all the dependencies are built as Nuget packages that are deployed together with the application. To optimize resources for the cloud it is partitioned into two sections: one for on premise solutions and the other for cloud application. The cloud improved system contains just the assets that are required from the sending of an application on cloud nothing else. Cloud optimized framework contains just the resources which are required from the deployment of applications on cloud nothing else. 

In the web application the web.config file is being replaced by project.json in which we can choose which package and its version we need to include in our application. This json file is used in all kinds of projects.

**6. See The Changes In Browser Without Re-building The Project-**
VS 15 gives a lightweight developer experience to ASP.NET applications. You just need to do changes in your code, save them and refresh the browser. You can see code changes in the web browser without re-building the project.

**7. Language Updates-**
Know more at- [https://solaceinfotech.com/blog/whats-new-in-net-5/]