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 for Converge360.

comments powered by Disqus

Featured

  • What's Next for ASP.NET Core and Blazor

    Since its inception as an intriguing experiment in leveraging WebAssembly to enable dynamic web development with C#, Blazor has evolved into a mature, fully featured framework. Integral to the ASP.NET Core ecosystem, Blazor offers developers a unique combination of server-side rendering and rich client-side interactivity.

  • Nearest Centroid Classification for Numeric Data Using C#

    Here's a complete end-to-end demo of what Dr. James McCaffrey of Microsoft Research says is arguably the simplest possible classification technique.

  • .NET MAUI in VS Code Goes GA

    Visual Studio Code's .NET MAUI workload, which evolves the former Xamarin.Forms mobile-centric framework by adding support for creating desktop applications, has reached general availability.

  • Visual Studio Devs Quick to Sound Off on Automatic Updates: 'Please No'

    A five-year-old Visual Studio feature request for automatic IDE updates is finally getting enacted by Microsoft amid a lot of initial developer pushback, seemingly misplaced.

  • First Official OpenAI Library for .NET Goes Beta

    Although it seems Microsoft and OpenAI have been deeply intertwined partners for a long time, they are only now getting around to releasing an official OpenAI library for .NET developers, joining existing community libraries.

Subscribe on YouTube