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

  • VS Code 1.123 Adds Agent Session Sync, 1M Context Windows

    Microsoft released Visual Studio Code 1.123 on June 3, adding agent-focused features, larger model context support, integrated browser updates and a new delay for some automatic extension updates.

  • Copilot Billing Shock Hits Developers

    Developer complaints about GitHub Copilot's new usage-based billing model have centered on unexpectedly rapid AI credit consumption, and neither GitHub nor Microsoft has responded directly to the backlash, though they have previously published guidance to lessen model usage costs.

  • Hands On with GitHub Copilot App Technical Preview: Turning a Blazor Issue into a PR

    GitHub's brand-new Copilot desktop app, in technical preview, handled a small Blazor issue from planning through pull request creation, but the hands-on test also showed why developers still need to verify agent work in the running app before merging.

  • At Build 2026, Microsoft Sets Up Windows as an OS for AI Agents

    Microsoft's Build 2026 Windows developer announcements point to a broader platform strategy for agentic AI, spanning terminal workflows, local models, app-building skills, Cloud PCs and operating system-level containment.

Subscribe on YouTube