You can reduce the quality of photos to speed up the loading of your site
NET 5., the successor to .NET Core 3.1. And .NET Framework 4.8., Intends to bring a new cross-platform development experience to .NET developers. Offer. This brings new good features. Of course, in this article you will not learn everything about .NET 5., but you can focus on 5 to get a better understanding of what is happening.
If you own a website or work on a customer website, then you need to know the importance of SEO. Without proper SEO strategies, you can not get high rankings in Google.
Success in a media channel such as organic search depends on the content. In particular, the production of useful content has the ability to rank. In its recent algorithm updates, Google has focused heavily on promoting great content and natural links, and penalizing poor content with unspecified links.
The first thing you need to know is that .NET 5. A new and integrated view of the .NET world. Brings to you.
If with .NET. If you have worked, you may be aware of the fragmentation of its platform since its first release in 2002. NET Framework. It was originally designed for Windows, but its runtime specification, also known as Common Language Infrastructure (CLI), was standardized as ECMA 335.
Standardization allows anyone to implement .NET runtime. Create. In fact, several of them appear on the horizon: Mono for Linux-based systems, Silverlight for browser-based applications, Micro frameworks, and .NET Compac. For mobiles and devices limited to resources, etc. Then Microsoft decided on .NET Core. Write from the beginning considering cross-platform compatibility.
These different implementations require an understanding of .NET packages. They created where they run from. Do you have to make different copies of your library to distribute it? The answer is NET Standard. Was. In other words if your libraries are for a .NET Standard. Specify, ensure that this implementation implements these specifications at all times.
You will find that it is not easy to achieve cross implementation compatibility in this busy situation. This is why .NET 5. appears on the scene.
New .NET platform. Integrated replacement of various .NET items. Is: .NET Framework., .NET Standard., .NET Core., Mono and so on. This is officially the next version of .NET Core 3.1. But basically the end of the .NET Framework., .NET Standard., And other versions that cause big trouble for .NET developers. It can be determined.
NET 5. Provides a common set of APIs that align various runtime implementations. This set of APIs is specified by net5.0 Target Framework Moniker (TFM), which is a token in the .NET project. Set to specify the target framework. Enables your applications to run a runtime implementation on any support. For example, to build any application that uses the Windows API, you must specify net5.0-windows TFM. That way, building a platform-specific application is your choice, not your choice of implementing the runtime you use to develop your application.
Of course, achieving this integrated platform required considerable effort and refinement of the interior architecture. As you will see later, some features have been removed from the main API suite, but the platform has reached an improved overall performance.
While the new .NET 5. is aimed at unifying the platform, the original program changed because of Corona. In fact, NET 5. is set up with the basics of integration, but will be completed with NET 6. in November 2021. With this version, you get stable release from the new global UI and support for specific TFMs, for example for Android (net6.0-android) and iOS (net6.0-ios).
New features in C#
The second thing you need to know about C#. NET 5. Comes with C# 9, a version of the original .NET platform programming language. There are several new features, but here are some important ones.
High level commands
Among the new features, one of the most important is the introduction of high-level commands. To learn what they are, take a look at the following program:
Just to write a string on the console, you need to define a namespace, a class, and a static Main() method. You can now get rid of this code infrastructure and easily write:
Top-level commands allow you to focus on what's really important in small console applications and applications, and use C # with more script-based approaches.
Another interesting and new feature is record types. With records, you can declare an immutable reference type, such as a class-based type that cannot be changed after creation. An example of an immutable type of internal reference is the System.String class. Once you have created an instance of System.String, you can no longer change its value.
Consider the following record type announcement:
You can create a copy of Person record as you would a class, but you could not modify the FirstName property:
However, you can easily compare two samples of Person record with initial values:
C# 9 also adds init access to define properties that can only be initialized. To better explain its uses, consider the definition of the following class:
This class defines a person with the LastName and FirstName properties that can be initialized but not changed. The Address property can be changed at any time.
NET MAUI., Global user interface
Third, NET 5. brings you a new way to create cross-platform user interfaces. Thanks to the .NET Multi-platform App UI framework, also known as .NET MAUI, you can create user interfaces for Android, iOS, macOS, and Windows with a single project.
In fact, this feature is still in development and will be released with .NET 6., but you can look at NET MAUI. Get started to be ready for an official release.
NET MAUI. The evolution of Xamarin.Forms, an open-source framework for building Android and iOS applications with a single .NET code, can be considered. But the new framework proposes a global model for building user interfaces on desktop and mobile platforms.
Plus for the well-known NET MAUI model, Model-View-ViewModel (MVVM). Supports the new Model-View-Update (MVU) template. It is a one-way data flow template inspired by the Elm programming language architecture and provides an effective way to manage UI updates and program status.
Support for single file applications
The fourth thing you will get in .NET 5. is support for single file applications, ie applications that are published and deployed as a single file. This means that your application and all its dependencies are in one file. For example, run the following command in your .NET folder:
A file containing your program built for Linux, all the dependencies you used in your project, and .NET runtime. You receive. This means that you do not even need to install a .NET runtime. Do not have on the device.
Of course, you can also specify these parameters in your project configuration:
Note that this feature is similar to the approach for single-file applications that you can find in .NET Core 3.1. Build does not use. In .NET Core 3.1, a single-file program is just a way to package binaries. At runtime, their packaging is opened, loaded, and executed in a temporary folder. In .NET 5., the single file program has a new internal structure and runs directly without any performance penalty.
Technologies that are no longer supported
The last of the 5 things we learned about NET 5. is about things that are no longer supported. As mentioned above, examining the architecture and attempting to create .NET 5. As a cross-platform programming framework led to the removal of several features supported in the .NET Framework. It becomes. Let's take a quick look at the removed features and possible options.
For a long time, ASP.NET Web Forms has been the main technology for building dynamic web interfaces. However, everyone knows that its lifespan was close to the fate of the .NET Framework. .NET Core does not support Web Forms, so the fact is that it is no longer supported in .NET 5. It should not be.
However, we do have some alternatives to building web UIs. If you are building a traditional web application, Razor Pages is one of these alternatives. If you want to create one-page applications, you can use Blazor.
Windows Communication Foundation (WCF)
Even WCF, the common communication framework for Windows, is obsolete. This may come as a bit of a shock to developers who use it to build service-driven applications. However, if you realize that the main goal of .NET 5. is to become a cross-platform framework, this would be quite understandable.
The recommended alternative to WCF by Microsoft is to migrate to gRPC. But if you want to work with WCF or have a smooth transition, you can try the CoreWCF open source project.
Windows Workflow Foundation
Finally, NET 5. does not even include the Windows Workflow Foundation, the workflow engine technology in the .NET Framework. There is no official alternative to this technology. However, you can use CoreWF to transfer existing workflows in .NET 5. or to create new ones.
At the end of this article, you have a high-level idea of how .NET 5 works on existing .NET projects. It affects and what opportunities this new platform intends to give you. These 5 important points may seem small, but they allow you to talk about this milestone in the evolution of .NET. Find your way