What's new in ASP.NET Core 6
I'm compiling information for our next Adelaide .NET User Group meetup which is focusing on the launch of .NET 6 and Visual Studio 2022.
Way back in February 2021, the major themes were outlined for ASP.NET Core in .NET 6. They were:
- Hot reload: Quickly make UI and code updates to running apps without losing app state for faster and more productive developer experience.
- Micro APIs: Simplify building API endpoints with much less code and ceremony.
- Single-file publishing: Build small, standalone, high-performance apps and services.
- WebAssembly ahead-of-time (AoT) compilation: Compile .NET code in Blazor WebAssembly apps directly to WebAssembly when publishing for significantly improved runtime performance.
- Updated single-page app (SPA) support Update SPA integration in ASP.NET Core to work seamlessly with the latest modern front-end JavaScript frameworks.
- Blazor hybrid desktop apps: Combine the best of Blazor and .NET Multi-platform App UI to build cross-platform hybrid desktop apps.
- HTTP/3: Add support for HTTP/3 and QUIC in ASP.NET Core supported servers.
Each preview then went on to incrementally work towards these goals:
Preview 1
- Support for
IAsyncDisposable
in MVC DynamicComponent
- Input
ElementReference
exposed on relevant components - Nullable reference type annotations
Preview 2
- Razor compiler updated to use source generators
- Support for custom event arguments in Blazor
- CSS isolation for MVC Views and Razor Pages
- Infer component generic types from ancestor components
- Preserve pre-rendered state in Blazor apps
- SignalR – Nullable annotations
Preview 3
- Smaller SignalR, Blazor Server, and MessagePack scripts
- Enable Redis profiling sessions
- HTTP/3 endpoint TLS configuration
- Initial .NET Hot Reload support
- Razor compiler no longer produces a separate Views assembly
- Shadow-copying in IIS
- Vcpkg port for SignalR C++ client
- Reduced memory footprint for idle TLS connections
- Remove slabs from the
SlabMemoryPool
BlazorWebView
controls for WPF & Windows Forms
Preview 4
- Introducing minimal APIs
- Async streaming
- HTTP logging middleware
- Use Kestrel for the default launch profile in new projects
IConnectionSocketFeature
- Improved single-page app (SPA) templates
- .NET Hot Reload updates
- Generic type constraints in Razor components
- Blazor error boundaries
- Blazor WebAssembly ahead-of-time (AOT) compilation
- .NET MAUI Blazor apps
- Other performance improvements
Preview 5
- .NET Hot Reload updates for
dotnet watch
- ASP.NET Core SPA templates updated to Angular 11 and React 17
- Use Razor syntax in SVG
foreignObject
elements - Specify null for
Action
andRenderFragment
component parameters - Reduced Blazor WebAssembly download size with runtime relinking
- Configurable buffer threshold before writing to disk in Json.NET output formatter
- Subcategories for better filtering of Kestrel logs
- Faster get and set for HTTP headers
- Configurable unconsumed incoming buffer size for IIS
Preview 6
- Improved Blazor accessibility
- Required Blazor component parameters
- Efficient byte array transfers for JavaScript interop
- Optional parameters for view component tag helpers
- Angular template updated to Angular 12
- OpenAPI support for minimal APIs
- Inject services into minimal APIs without
[FromServices]
attribute - Configure the accept socket for Kestrel
IHttpActivityFeature
- Long running activity tag for SignalR connections
- WebSocket compression
- SignalR WebSockets TestServer support
- New
OnCheckSlidingExpiration
event for controlling cookie renewal - ClientCertificateMode.DelayCertificate
Preview 7
- Parity with existing experiences for minimal APIs
- Added
IResult
implementations for producing common HTTP responses - Support Request, Response and User for minimal actions
- Minimal host and template improvements
- Supply Blazor component parameters from the query string
- Replace the current URI in the browser history from Blazor
- New
DynamicComponent.Instance
property - Blazor streaming interop from JavaScript to .NET
- Large file upload & faster file uploads with Blazor
- Modify HTML
<head>
content from Blazor components - Support for the multiple attribute on
<select>
elements in Blazor - Support for HTTP/3 in Kestrel
- QUIC support moved to the shared framework
- Allow control over
Activity
creation - Support for non-ASCII characters in Kestrel response headers
- Add W3CLogger
- Add authentication expiration option to SignalR
Release Candidate 1
- Render Blazor components from JavaScript
- Blazor custom elements
- Manipulate the query string from Blazor
- .NET to JavaScript streaming
PageX
andPageY
inMouseEventArgs
- Blazor templates updated to set page titles
- Disabled long-polling transport for Blazor Server
- Collocate JavaScript files with pages, views, and components
- JavaScript initializers
- Customize Blazor WebAssembly packaging
- Template improvements
- Minimal API updates
- Support for Latin1 encoded request headers in
HttpSysServer
- Emit KestrelServerOptions via EventSource event
- Add timestamps and PID to ASP.NET Core Module logs
- New
DiagnosticSource
event for rejected HTTP requests - Create a
ConnectionContext
from an Accept Socket - Streamlined HTTP/3 setup
- Upgrade to Duende Identity Server
In addition to these regular previews, two other blog posts were published that relate to ASP.NET Core 6:
- ASP.NET Core 6 and Authentication Servers - .NET 6 will have IdentityServer templates. .NET 7 options under consideration.
- HTTP/3 support in .NET 6 - HTTP/3 support is included as a preview feature in .NET 6 (partly due to the fact that the RFC for HTTP/3 has not been finalised yet)
Categories: .NET