News

Microsoft Ships Last Preview of .NET 7 Before Release Candidate

Microsoft today (Aug. 9) shipped .NET 7 Preview 7, the final preview before it hits Release Candidate stage in advance of a Nov. 10 debut.

Preview 7 has been tested with Visual Studio 17.4 Preview 1, which also was released today along with the final VS 2022 v17.3 release.

.NET 7 will finally unify all the disparate .NET dev tooling components, enabling developers to build all types of apps -- desktop, mobile, web and more -- on the same Base Class Library (BCL), runtime and compilers. This was actually the goal of .NET 5 -- a successor to the .NET Core offerings -- when it debuted in November 2020. However, development problems exacerbated by the COVID-19 pandemic kept that from happening, so not all the planned bits made it into .NET 5 and were postponed until .NET 6 arrived in November 2021 as a Long Term Support (LTS) release. Even then, though, Microsoft's overarching unification effort was incomplete because some components, such as .NET Multi-platform App UI (.NET MAUI), slipped the schedule. .NET MAUI has since reached General Availability, so full unification is expected in November.

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

For Preview 7, the dev team focused on improving System.LINQ, Unix file permissions, low-level structs, p/Invoke source generation, code generation and websockets, said Jeremy Likness, senior program manager, in an Aug. 9 announcement post. All those specific items fall somewhere under general guidance provided in the Themes of .NET site.

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

Here are summaries of those improvements, with links to associated GitHub issues and pull requests for more information:

  • Simplified ordering with System.LINQ: System.Linq now sports new methods, Order and OrderDescending, which are used to order an IEnumerable according to T. This stems from dotnet/runtime#67194.
  • Support for Unix file modes: This uses a new enum and APIs to address the lack of built-in support for getting and setting Unix file permissions, used to control which users can read, write and execute files and directories. This stems from dotnet/runtime PR#69980.
  • Low-level struct improvements: ref field support: The .NET 7 runtimes now fully support ref fields within ByRefLike types: ref and struct. "There was extensive language design behind this much requested feature that users can read about: low-level struct improvements," Likness said. "With this feature, types previously requiring specialized handling in the runtimes (for example, Span<T> and ReadOnlySpan<T>), can now be fully implemented in C#."
  • LibraryImport P/Invoke source generator: Likness said this reflects the culmination of more than 18 months of work on the LibraryImport source generator, intended to be a drop-in replacement for most DllImport uses in both the runtime product and in user code. LibraryImport has been rolled out to all .NET libraries, which have been shipping with source generated marshalling code since .NET 7 Preview 1. "The source generator ships with the .NET 7 TFM and is readily available for consumption," Likness said. "In order to get the benefit of the source generated marshalling, replace usages of DllImport with LibraryImport. There are Analyzers and Fixers that can assist with this process." This stems from dotnet/runtime#60595.
  • ClientWebSocket upgrade response details: ClientWebSocket now provides details about upgrade responses, specifically information about response headers and status codes, which can be valuable in both failure and success scenarios. The latter can help developers distinguish between retriable and non-retriable errors when failures occur, while headers might also contain additional information on how to handle such situations and also prove helpful even in successful web socket connections, in that they can contain a token tied to a session, some info related to the subprotocol version and other information. This stems from dotnet/runtime#25918.

Likness also listed several improvements to CodeGen and loop optimizations, along with some breaking changes in the preview.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube