Inside .NET 6 – Florida News Times

NS The next version of the .NET platform is imminent. With the new annual release rate, .NET 6 will be the first long-term support release of .NET integrated. This is a bigger event than most because it is the first event an organization can truly trust to use as the basis for its development strategy.

Microsoft recently released its first release candidate, one of two that come with a “working” license that guarantees Microsoft support for production applications. It is still a big step. At this point, the prototypes and other tests used have been used on a large scale, revealing bugs. That’s why Microsoft is making support available so the .NET team can see the extreme cases that their own tests couldn’t reach.

Need to start switching to .NET 6? Of course, if you are already using .NET 5, the migration should be relatively easy and the new version should add a lot of new features. .NET 6 adds more compatibility features, but migrating from the .NET Framework remains difficult. Still, there are enough differences between the two platforms, making code migration an important project. Still, it’s probably a good time to start the migration, as support is readily available, targeting long-term releases.

you can download the current Microsoft runtime environment and installer now. Support for developer tools in the latest preview release of Visual Studio 2022 (slated to launch with .NET 6 in .NETconf in November). The versions of Visual Studio 2022 for macOS that support .NET 6 are: Currently in private preview.

Remove the cover of the new .NET compiler

For most of us, the language we use is the main point of contact for .NET, and like previous versions, .NET 6 brings new versions of this major tool. However, the most important part of the new version is inside the tools that get the code and run it on target hardware, from handheld ARM devices to large multi-core cloud x64 systems.

Much of the Work in .NET 6 Compiler Improvements Work on optimizing code using profile-based optimization within your project and build an optimized runtime library. It’s probably best to think of it as a .NET 7 teaser. You can get some static benefits. Profile Based Optimization Included in Code (PGO), but I can’t use it myself yet. At the same time, there is a dynamic activation PGO tool built into the .NET JIT compiler. This is a good way to improve the performance of code execution, however, optimization is lost between executions.

Dynamic PGO takes advantage of .NET 6 support for hierarchical compilation. It uses an alternate level 0 build path to quickly create unoptimized code. Once you get that, you can see which method is used the most. These methods can be optimized with the level 1 compiler path based on data from previous runs. The resulting code has a larger memory footprint, but is significantly faster. Microsoft documentation provides examples that are more than twice as fast as code that does not use dynamic PGO.

All of these features are part of the new Crossgen2 compiler. This is an important stand-alone tool that works with .NET JIT to provide code that can be executed anywhere there is a supported set of .NET. This allows you to create your code for one environment and then deliver it to another. Crossgen2 generates ready-made code and compiles the entire assembly before running it. It’s inefficient, but it’s the start of a future version of the compiler. It currently supports the old instruction set running on new hardware, but has been replaced by new instructions that use the latest cloud-scale hardware. Crossgen2 is probably best seen as the first path to a new way of creating and delivering code. It’s a combination of JIT and just-in-time build, but you won’t see all the benefits until .NET 7. 2022 is released.

Network stack changes

One of the most important changes in .NET networks is the support for HTTP / 3 and QUIC protocols. It integrates Transport Layer Security (TLS) and User Datagram Protocol (UDP) to enhance support for secure HTTP connections and avoid blocking connections. QUIC (Quick UDP Internet Connection) is independent of the underlying connection address, making it easy to roam connections between wired, wireless and cellular. This makes roaming much easier as long transactions such as downloads can continue to work even if the device’s underlying connection to the internet changes.

Support for the underlying QUIC protocol is important for other reasons. The move from .NET Framework to .NET Core, which started with .NET 5, left behind some major .NET components, such as WCF, the Windows Communication Foundation. The WCF API has been used to build service-oriented applications in .NET, a model that becomes more and more important as we move to cloud-native applications. Microsoft recommends migrating to gRPC We are working on an HTTP / 3 based implementation as a way to implement a service endpoint. This approach makes a lot of sense for mobile and device applications where the connection can switch between Wi-Fi and cellular depending on location and conditions.

Migrating from HTTP / 2 to HTTP / 3 with gRPC is not a big step, but it should significantly improve performance, especially for mobile devices, Internet of Things, and other edge implementations. You can try it out now by enabling HTTP / 3 support in your code and then implementing the gRPC interface. If supported by the host operating system, the client code should automatically negotiate an HTTP / 3 connection.

When Windows and Linux support HTTP / 3 for .NET 6, Apple doesn’t provide a QUIC API, so it’s not on macOS. However, as QUIC grows in popularity, it can get support relatively quickly. In the meantime, code that uses gRPC HTTP / 3 must be written to respond to standard gRPC calls over HTTP / 2.

Open .NET

Another interesting development of .NET 6 is the ability to create a probably open source runtime environment. Most Linux distributions require you to build your tools using open source tools. For .NET, a two-step process is required. To make this possible, Microsoft is now able to provide .NET source code in a source archive, just like any other major Linux component. Previously this was a manual process that often delayed the distribution, but now it is an automated part of the .NET build process, where the code of Linux distributions such as Red Hat is synchronized with the own. versions of Microsoft. Guarantee.

Support for tar source archives is an important sign that Microsoft and the .NET Foundation are working on an open .NET. Despite a lot of work on the latest version outside of Microsoft, Redmond remains by far the biggest contributor. However, Microsoft uses blogs to contact library contributors and to refer to partnerships with companies such as Red Hat. It makes sense that Microsoft is betting openly on .NET. As the IT environment expands and new architectures such as ARM’s new instruction set emerge, a large number of platforms need to be targeted.

Copyright © 2021 IDG Communications, Inc.

Source link

Comments are closed.