Brief Summary
This YouTube video showcases the new features and improvements in ASP.NET Core and .NET 10 Preview 6. It covers Kestrel memory management, validation support for Blazor, pass key authentication, state persistence in Blazor server apps, and the new MCP server packaging scenario. The video also introduces net tool exec
and DNX
commands for easier tool execution.
- Kestrel's improved memory management reduces memory usage after traffic spikes.
- Validation support is extended to Blazor, enabling complex model validation in forms.
- Pass keys offer a secure, phishing-resistant alternative to passwords.
- State persistence enhances the resiliency and scalability of Blazor server apps.
- MCP servers can now be packaged and distributed as NuGet packages.
Introduction
The host introduces the Net Unboxed episode, highlighting the absence of James and the presence of Dan, Chat, and Joel, who will present new features and a surprise at the end.
Kestrel Memory Management
Kestrel, the built-in HP server, now manages memory more efficiently by releasing unused memory, addressing issues faced by services like Azure App Service that handle billions of requests daily. These improvements are included by default in .NET 10 Preview 6, resulting in better scaling, lower idle costs, and smarter resource utilization for all users.
Validation Support for Blazor
Validation capabilities, previously added to minimal APIs, are now available for Blazor. This allows for validating nested complex models in Blazor forms using the existing data annotations validator component. A shared validation implementation has been moved to Microsoft.Extensions.Validation
. To enable this functionality, the add validation
API call needs to be added in program CS.
Pass Keys Support
ASP.NET Core now supports web authentication (WebAuthn) and pass keys, which are cryptographic credentials that replace traditional passwords. Pass keys consist of a public-private key pair scoped to a specific account and origin. The private key is stored in an authenticator app. Built-in support for pass keys has been added to ASP.NET Core Identity, drawing inspiration from the open-source 502 net lib library. The Blazer web app project template has been updated to include pass key support when enabling individual user accounts.
Blazor State Persistence
Blazor has improved support for state persistence, including persisting component states during pre-rendering. New features enhance the resiliency of Blazer server apps by allowing the persistence of circuit state when a client disconnects. This ensures that users can resume their work uninterrupted after prolonged disconnections. Additionally, APIs are provided to implement policies for persisting and rehydrating circuits to improve scalability.
ASP.NET Core and .NET 10 Preview 6 Features Overview
Dan summarizes the new features in ASP.NET Core and .NET 10 Preview 6, highlighting the focus on completing big features before moving to release candidates. He also addresses questions about validation behavior, state storage, and the supply comp parameter
attribute, which is being renamed to persistent state attribute
in PB7.
Introduction to .NET CLI Tools
Chat discusses .NET CLI tools, which are framework-dependent, runtime-agnostic binaries that can be easily distributed and used by others with the .NET SDK. The key components of a tool are the package type net tool
and the net tool settings XML
file, which specifies the command to be invoked.
Platform-Specific .NET Tools
.NET 6 introduces support for platform-specific tools, allowing developers to create native tools for Windows or Mac OS. This involves specifying runtime identifiers for packages and using Netpack
to build runtime-specific packages. The net tool exec
command facilitates acquisition and execution of tools in one step.
AOT Compilation for .NET Tools
The .NET runtime team provides tools to manage the size of applications, which are compatible with the new RID-specific .NET tools. AOT (Ahead-of-Time) compilation can be used to create smaller, faster tools. To use AOT, developers need to matrix over the different platforms they want to support and call pack for the specific runtime identifier.
DNX Command for Tool Execution
Starting in Preview 6, the DNX
command can be used to run any tool, automatically acquiring it if necessary. This simplifies tool execution and makes it more intuitive.
Security Considerations for .NET Tools
Chat addresses security concerns related to downloading and executing .NET tools. Users must provide positive affirmation to install tools, and the system checks for local availability before prompting for download. NuGet configurations and package source mappings can be used to manage versions and sources.
Packaging MCP Servers as NuGet Packages
Joel introduces a new NuGet package scenario: packaging MCP (Message Passing Copilot) servers. MCP is a protocol that augments copilot agents or LLMs with external knowledge. A new template is available for creating MCP servers using C#.
Creating and Running an MCP Server
The template sets up a locally running .NET tool that uses the MCP protocol. The code includes tools that an AI agent can call. Joel demonstrates running an MCP server locally and invoking it using VS Code.
Publishing and Consuming MCP Servers
MCP servers can be packaged and published to nougat.org. The browsing experience for MCP servers has been enhanced with a new filter package type. Users can consume MCP servers by copying a config and using it in VS Code to call out using DNX.
Demonstration of MCP Server Consumption
Joel demonstrates consuming an MCP server from nougat.org using DNX. The system prompts for permission before calling out to the server. The demonstration shows how to configure inputs and invoke tools within the MCP server.
Feedback and Survey
Joel encourages users to provide feedback on the MCP server experience. A quick start guide and a survey are available for users to share their thoughts and suggestions. The host shares a blog post with a walkthrough and a survey link.