.NET 6: The MOST promising FEATURES 🔥
Tags: dotnet, netcore, csharp, dotnet6
Published: 2021-07-20 15:38:00

**Microsoft** is putting the batteries and already presents .NET 6 Preview 5. According to what they tell us, they are already in the second half of the **.NET 6** version and they are beginning to teach new features that promise a lot. 🤗

---


## What is .NET? What is it for?

What is .NET in general, is a _Microsoft_ platform to develop Software, covering many operating systems such as **Windows**, **iOS**, **Linux**, **Android** … The main idea of ​​.NET is to be able to develop applications independent of the physical architecture or the operating system in the one that was going to be executed.  
Its main advantages are:

*   **Decreased** development time
*   Use of **predesigned functionalities**
*   **Reduction** of development and maintenance cost
*   **Simplification** of maintenance

> Okay, I understand. And what is .NET 6? _🤔_

.NET 6 is the new version of .NET _(currently .NET 5)_ that Microsoft promises to release on **November 9** of this year. It brings many improvements and new features compared to .NET 5.

---


## What are .NET 6 new features?

If we speak in general, we can speak from .NET MAUI, through the new implementation of the 64-bit architecture, to Visual Studio 2022 and its function more... 😎 But we are going to explain the most important ones and the ones you should know.

---


### NuGet package validation

Package validation tools will allow **NuGet** library developers to validate that their packages are consistent and well-formed.

Its main characteristics are:

*   Validate that there are **no important change**s in the versions
*   Validate that the package **has the same set of public APIs** for all specific runtime implementations.
*   Determine **applicability gaps in the target framework** or in the execution time.

---


### Workload Enhancements in the .NET SDK

Microsoft reports that it has added new workload commands in .NET 6 to improve administration:

*   `dotnet workload search` List the workloads available to install.
*   `dotnet workload unistall` Removes the specified workload if you no longer need a workload. It is also a good option to save space.
*   `dotnet workload repair` Reinstall all previously installed workloads.

---


### Crossgen2

[Crossgen](https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/crossgen.md) allows **IL** precompiling into native code as a publishing step. Pre-compiling is primarily beneficial to improve startup. **Crossgen2** is a scratch implementation that is already proving to be a superior platform for code generation innovation.

Here we can see how to enable the pre-compilation with Crossgen2 from the _MSBuild_ properties:


```csharp
<!-- Enable pre-compiling native code (in ready-to-run format) with crossgen2 -->
<PublishReadyToRun>true</PublishReadyToRun>
<!-- Enable generating a composite R2R image -->
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
```

---


### Windows Forms: The default font

Already with .NET 6 you can set a default font for an `Application.SetDefaultFont`application. Also the pattern it uses is similar to setting high dpi or visual styles. An example:

```csharp
class Program  
{  
\[STAThread\]  
static void Main()  
{  
Application.SetHighDpiMode(HighDpiMode.SystemAware);  
Application.EnableVisualStyles();  
Application.SetCompatibleTextRenderingDefault(false);\+
Application.SetDefaultFont(new Font(new FontFamily("Microsoft Sans Serif"), 8f));Application.Run(new Form1());  
}  
}
```

Here are **2 examples** after you set the default font.

Microsoft Sans Serif, 8pt:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rk0ekidd35r4ljheiepk.png)

Chiller, 12pt:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77wetdelxsk6mpu0c5i4.png)

---


### Performance increase in the BigInteger library

BigIntegers parsing of decimal and hexadecimal strings has been improved. In the following photo you can see improvements of up to **89%**:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3n818l5aaxu5pccq3pz5.png)

---


### SSL 3 support

The .NET crypto APIs support the use of **OpenSSL 3** as the preferred native crypto provider on _Linux_. .NET 6 will use **OpenSSL 3** if available. Otherwise, it will use **OpenSSL 1.x**.

---


### IOS CPU Sampling (SpeedScope)

The graph below shows part of an **iOS** startup _CPU_ sampling session seen in **SpeedScope**:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zz5z1z9pszz61d84z5j.png)

---


### Android CPU Sampling (PerfView)

The following image shows the **Android** _CPU_ sampling seen in **PerfView**:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gswxhvdc6f7fmj73avkn.png)

---


## .NET 6 Conclusion

This .NET 6 Preview 5 is perhaps the biggest so far of all the ones that have been released in terms of quantity and quality of features. Right now you can try .NET 6 by downloading it from the **Official Web of .NET 6.**

As Microsoft says…

> The future has arrived

With all the tools already announced and all that remain to be shown and released, development will become a much easier, more optimized and more productive task, highly improving the developer experience in their current and future projects.

We would like to know your opinion. Sound good features? Anything you would like them to take out? Leave it in the comments so we can talk about it.😊