News

What's New for Web, Data, Desktop and Mobile in .NET 9 Preview 4

Microsoft's newly shipped fourth preview of .NET 9 sees minor improvements across the framework's components, affecting developers for the web, desktop, mobile and data.

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

Spanning those components are the framework's libraries and runtime, where new work includes:

  • UnsafeAccessorAttribute supports generic parameters: This support allows unsafe access to type members previously inaccessible to the caller. Originally introduced in .NET 8 without generic parameter support, this enhancement was prioritized based on community feedback and is now available for CoreCLR and native AOT scenarios. Additional work, including support in mono, is ongoing and detailed here.
  • Feature switches with trimming support: This enables the definition of feature toggles in .NET libraries. The FeatureSwitchDefinitionAttribute treats feature switch properties as constants during trimming, allowing unused code to be removed. Similarly, FeatureGuardAttribute uses properties as guards for code requiring dynamic features, ensuring that unnecessary code is excluded during native ahead-of time (AOT) compilation. This ensures optimized performance by trimming out non-essential code based on the application's configuration.
  • Tokenizer library enhancements: Tokenizer overloads accept Span<char>, enhancing control over normalization and pre-tokenization. Additionally, a new CodeGen tokenizer supports models like codegen-350M-mono and phi-2, allowing for efficient encoding of text. These improvements are detailed here.
  • OpenTelemetry: Make activity linking more flexible -- The Activity.AddLink method enables the addition of links to an Activity object after its creation. This enhancement aligns .NET more closely with OpenTelemetry specifications, as previously, activity linking could only occur during the creation of an Activity object. This update provides greater flexibility in linking an Activity to other tracing contexts, facilitating better tracing and monitoring capabilities within applications. More info is here.
  • PDB support for System.Reflection.Emit.PersistedAssemblyBuilder: This support enables the emission of symbol information for debugging assemblies created with Reflection.Emit. The new APIs include methods for defining documents, marking sequence points, and setting local symbol information, closely mirroring the .NET Framework's functionality. These enhancements facilitate the generation of portable PDBs, improving the debugging experience for dynamically generated assemblies.

Summaries of other areas include:

.NET Data & EF Core
Full release notes are here, detailing:

.NET MAUI
Full release notes are here, detailing:

ASP.NET Core
Full release notes are here, detailing:

WPF
Full release notes are here, detailing:

More information can be found in the newly updated What's new in .NET 9 documentation for the next iteration of the framework, due to debut in November.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events