News

.NET 6 Release Candidate 1 Ships

Microsoft shipped the first of two Release Candidate versions of .NET 6, set to debut in November as a consolidation of all the disparate .NET dev tooling components under one cross-platform, open source umbrella offering.

This years-long, game-changing effort was supposed to culminate last year with the introduction of .NET 5 (itself stemming from the .NET Core project, which stemmed from .NET Framework), but the ongoing COVID-19 pandemic and other issues delayed the effort by a year. Finally, however, all the missing parts -- primarily Xamarin for mobile/client development (it's now .NET MAUI, with desktop support) and Mono, a free and open source .NET Framework-compatible software framework.

Company dev teams have been infusing new features and functionality into .NET 6 for months over a series of previews, most recently just focusing on polishing them up, so the code has already been deemed ready for real-world production testing. Thus today's RC 1 announcement doesn't focus on new goodies, but rather foundational features of .NET 6, many of which won't be fully realized for a while. Microsoft's Themes of .NET site provides a high-level view of what's in store:

Themes of .NET
[Click on image for larger view.] Themes of .NET (source: Microsoft).

"In each release, we take on a few projects that take multiple years to complete and that (by definition) do not deliver their full value for some time," said Richard Lander, program manager, .NET Team, in a Sept. 14 blog post. "Given that these features have not come to their full fruition, you'll notice a bias in this post to what we're likely to do with these features in .NET 7 and beyond."

The .NET Schedule
[Click on image for larger view.] The .NET Schedule (source: Microsoft).

Here's a capsule summary of such features highlighted by Lander:

  • Source build: The GitHub repo for this says: "The key goal of source-build is to satisfy the official packaging rules of commonly used Linux distributions, such as Fedora and Debian. Many Linux distributions have similar rules. These rules tend to have two main principles: consistent reproducibility, and source code for everything." See more on this here.
  • Profile-guided optimization (PGO): In a May "Conversation about PGO," Microsoft had this to say about PGO: "PGO improves the performance of applications by adding new information to the optimization process that is dependent on how the application executes, not just on the program's code." Today, Lander said developers can use PGO to:
    • Compile startup code at higher-quality.
    • Reduce binary size by compiling low-use code at lower-quality (or not at all).
    • Re-arrange application binaries such that code used at startup is co-located near the start of the file.

    The team has been building the foundation that can enable optimal PGO experiences in .NET 6. "At present, we haven't enabled anyone else to use PGO to optimize apps. That's what will be coming next with .NET 7," Lander said. See more on this here.

  • Dynamic PGO: This concerns improving how the just-in-time (JIT) compiler produces and consumes profile data, emphaszing "dynamic" scenarios where everything happens in-process. "Dynamic PGO is the mirror image of the static PGO system," Lander said. "Where static PGO is integrated with crossgen2, dynamic PGO is integrated with RyuJIT. Where static PGO requires a separate training activity and using special tools, dynamic PGO is automatic and uses the running application to collect relevant data. Where static PGO data is persisted, dynamic PGO data is lost after every application run. Dynamic PGO is similar to a tracing JIT." See more on this here.
  • Crossgen2: Crossgen2 replaces crossgen: Crossgen2 has been enabled for all existing crossgen scenarios, and Microsoft also removed (the old) crossgen from the SDK, making it no longer accessible and unable to be used. "Crossgen (1 and 2) enables pre-compiling IL to native code as a publishing step. Pre-compilation is primarily beneficial for improving startup. Crossgen2 is a from-scratch implementation that is already proving to be a superior platform for code generation innovation. For example, crossgen2 can generate code for a broader set of IL patterns than crossgen1." See more on this here.
  • Security mitigations: For this release, the team added preview support for two key security measures that will be enabled by default in .NET 7:
    • CET: Control-Flow Enforcement Technology comes from Intel, introduced last year to protect against common malware threats. Available in some newer Intel and AMD processors, it adds capabilities to hardware that can protect against some common types of attacks involving control-flow hijacking, Lander said. See more on these here.
    • W^X: Wikipedia says this stands for "write xor execute" and is pronounced W xor X. With its capability to block a basic attack path by disallowing memory pages to be writeable and executable at the same time, Lander said it's a fundamental mitigation so effective that Microsoft has eschewed using more advanced mitigations because they could be bypassed by the lack of this capability. Instead, the company will add other complementary mitigations such as CET. See more on this here.
  • HTTP/3: Still officially in the draft stage, this third version of the HTTP protocol is already well used, Wikipedia says, running over the QUIC encrypted general-purpose transport protocol, which multiplexes multiple streams of data on a single connection. As an official draft presented in preview in .NET 6, Lander said its use of QUIC solves existing functional and performance challenges. "We have included HTTP/3 in .NET 6 so that you can start experimenting with it," Lander said. "It is a preview feature, and so is unsupported. There may be rough edges, and there needs to be broader testing with other servers & clients to ensure compatibility." See more on this here.
  • SDK workloads: This a new scheme for SDK workloads highlighted in .NET 6 Preview 5, enabling Microsoft to add support for new application types without increasing the size of the SDK. It is replacing the old monolithic SDK approach, which was burdened by a long build times and large distribution sizes. "In future releases, we intend to remove more components and make them optional, including ASP.NET and the Windows Desktop," Lander said. "In the end, one can imagine the SDK containing only MSBuild, NuGet, the language compilers and workload acquisition functionality. We very much want to cater to a broad .NET ecosystem and to deliver just the software you need to get your particular job done. You can see how this model would be much better for CI scenarios, enabling dotnet tools to acquire a bespoke set of components for the specific code being built." See more on this here.

".NET 6 has a lot of new features and capabilities that are for the here-and-now, most of which have been explored in all the previews and also in the upcoming .NET 6 posts," Lander said in conclusion. "At the same time, it's inspiring to see the new features in .NET 6 that will lay the foundation for what's coming next. These are big-bet features that will push the platform forward in both obvious and non-obvious ways.

"For the first several releases, the team needed to focus on establishing .NET Core as a functional and holistic open source and cross-platform development system. Next, we focused on unifying the platform with Xamarin and Mono. You can see that we're departing from that style of project to more forward-looking ones. It's great to see the platform again expand in terms of fundamental runtime capabilities, and there's much more to come along those lines."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

Subscribe on YouTube