dotnet-9

What’s New in Blazor with .NET 9?

Overview

.NET 9, the successor to .NET 8, brings some fantastic enhancements and features. It’s like getting a shiny new toolbox for software development adventures.

Focus on Cloud-Native Apps and Performance

.NET 9 has its sights set on cloud-native applications and performance improvements. Whether you’re building web services, microservices, or other cloud-based solutions, .NET 9 has your back.

Release Date

The final release of .NET 9 is expected in November 2024 during the exciting .NET Conf event. Mark your calendars! 🗓️
Support Duration

.NET 9 will be supported for a standard 18-month term. So, you’ll have plenty of time to explore and adopt its features.

Key Features

.NET Runtime

  • Feature Switches with Trimming Support
    The .NET 9 runtime introduces a new attribute model for feature switches. These allow libraries to toggle specific functionality. Imagine having a switch to turn on or off certain features—pretty cool, right?
  • Dynamic Garbage Collection Adaptation
    The garbage collector now dynamically adapts to your application’s size. No more one-size-fits-all—this is like a custom-tailored suit for memory management.
  • Performance Boosts
    The runtime includes various performance improvements, from loop optimizations to inlining and Arm64 vectorization. Your code will run faster than ever!

.NET Libraries

  • System.Text.Json Enhancements
    Customize JSON indentation and serialize using web defaults with ease. Plus, LINQ gets new methods for aggregating state by key without unnecessary intermediate steps.
  • PriorityQueue
    If you’re dealing with collections, the new PriorityQueue type now has a method to update an item’s priority. Prioritize like a pro!
  • Cryptography Goodies
    .NET 9 adds a one-shot hash method and new classes using the KMAC algorithm. Secure your data like a secret agent.
  • Reflection Magic
    The PersistedAssemblyBuilder lets you save emitted assemblies, complete with PDB support for debugging. Debugging just got a whole lot easier.
  • TimeSpan Improvements
    Create TimeSpan objects from integers (no more floating-point imprecision). Time flies, but your calculations won’t!

.NET SDK

  • Workload Sets
    Keep your workloads at specific versions until you’re ready to update. It’s like having a shelf for your tools, neatly organized.
  • Parallel Unit Testing
    Run tests in parallel with better MSBuild integration. Testing just got turbocharged.
  • NuGet Security Audits
    Audits now cover both direct and transitive package references. Safety first!
  • Terminal Logger
    Enabled by default, with improved usability. Now you’ll know exactly how many failures and warnings you’ve got.

Blazor improvements with .NET9

Blazor, the web framework that lets you build interactive web applications using C# and .NET, gets some fantastic upgrades in .NET 9. If you’re a web developer, get ready for a game-changer! Here’s what you need to know:

Blazor Interactive Render Mode

In .NET 9, Blazor introduces an interactive render mode for web apps. Imagine building dynamic UIs with C# and having them respond instantly to user interactions. It’s like magic!

Blazor Hybrid Apps with .NET MAUI

The future is hybrid! .NET 9 brings us a new template that allows you to create Blazor Hybrid apps targeting both web and native mobile/desktop platforms through .NET MAUI. Now you can share your UI components seamlessly across different platforms.

Key Features

Blazor Web App Authentication

  • Easy Configuration
    .NET 9 simplifies authentication setup in Blazor Web Apps. Whether you’re using OAuth, OpenID Connect, or custom authentication schemes, the new tooling makes it a breeze.
  • Microsoft Identity Platform Integration
    You can now choose Microsoft Identity Platform auth as an option in your Blazor web app template. Secure your app with confidence!

Improved State Management

  • Persistent State Enhancements
    Blazor in .NET 9 improves how it handles persistent state during enhanced navigation. Say goodbye to lost data when users navigate between pages.
  • Declarative State Persistence
    A simplified method lets you persist state between prerendering and interactive rendering. It’s like having a memory that never forgets.

Blazor Server Reconnection Logic

  • Better Reconnection Handling
    Blazor Server now has improved reconnection logic. If a user’s connection drops, your app gracefully reconnects without missing a beat.

Blazor with .NET 9 is a powerhouse for web development. Whether you’re building interactive web apps or hybrid solutions, these features will make your life easier.