Microsoft Ships .NET 11: C# 15 Adds Union Types and an MCP Server Template for AI Agents
Microsoft has released .NET 11, the new version of its application platform, together with C# 15. The headline feature, union types, lets you declare that a method returns either a successful result or an error, and the compiler will not let you forget to handle both cases. For AI projects, Microsoft added an MCP server template: a ready-made service skeleton that AI clients connect to as a set of tools. That makes it easier for .NET teams to build agents on a stack they already know.
AI-processed from Habr AI; edited by Hamidun News
Every .NET developer knows this situation: a method returns either a result or an error, and somewhere in the code one of the cases was forgotten. The bug surfaces only in production. Microsoft has released .NET 11, the new version of its open-source application development platform, along with the C# 15 language. The main idea of the release is to hand these checks over to the compiler. The platform also gets scaffolding for AI applications, including an MCP server template. It is a ready-made service skeleton that AI clients connect to as a set of tools.
Union Types and Closed Hierarchies: The Compiler Checks Your Work
The main new feature in C# 15 is union types. They let you specify in advance which types are allowed for a single value. The announcement's example describes an operation result as a union of two types: a successful response and an error. If you write code that unpacks this result, the compiler makes sure all the variants are handled. Forgetting to handle the error becomes harder.
The second new feature follows the same idea: closed class hierarchies. If a class is marked with the closed modifier, it can only be inherited directly within the same assembly. This means the compiler knows the full list of subclasses in advance. In a switch construct, it will verify that you have handled each of them. If a new subclass is later added to the assembly and its handling is forgotten, this shows up at compile time rather than in front of users.
In practice, models such as "result or error" or "one of several commands" can now be expressed in the type itself, rather than in verbal agreements within a team.
Faster Build and Runtime, More Library Capabilities
In the SDK, the precompiled version of the dotnet command-line tool and the MSBuild server are now enabled by default. The server stays running between commands, so repeated operations should run faster. The SDK installation packages for Linux and macOS have been reduced in size by removing duplicate files.
The team continued optimizing the Runtime and the JIT compiler. Improvements cover branching, array bounds checks, and interface calls. For Native AOT, the amount of generated code has been reduced. On Linux and macOS, more information about the program's state can now be saved when a crash occurs, which helps when analyzing failures.
The standard libraries gain Zstandard compression support, new JSON capabilities, and several ways to work with in-memory data without preliminary copying. Entity Framework Core 11 receives additional query optimizations and FullJoin support. For SQL Server, experimental support for vector indexes and search has been added. The word "experimental" matters: for critical systems, this is a reason to test, not to migrate.
What the Release Offers for AI Development
Microsoft singled out AI applications separately. The MCP server template is meant to quickly build a service that AI clients can call for tools: database search, calls to an internal API, and so on. The Microsoft.Extensions.AI library provides a unified set of interfaces for connecting models, so the code is less tied to a specific provider. Microsoft Agent Framework is designed for building agents that use tools, maintain state, and operate within more complex workflows.
For teams already writing in .NET, this makes it possible to build agents and MCP servers on a familiar stack. Learning Python specifically for this is not required, although the choice depends on the task and the ecosystem.
What to Consider Before Upgrading
.NET 11 is an STS (Standard Term Support) release and will be supported for two years. If a project needs a longer support window, Microsoft still recommends .NET 10 LTS. A practical plan is to try .NET 11 on new or experimental services, evaluate union types and closed hierarchies on a small part of the codebase, and keep production systems with long lifecycles on LTS. SDK and Runtime builds are available for Windows, Linux, and macOS, so the new version can be tested on any working machine.
The announcement contains no benchmarks or exact speedup figures, so claims about "faster repeated operations" should be verified on your own projects. The main practical effect of the release is more checks at compile time and ready-made scaffolding for AI services built into the platform itself.
- Dec 2, 2026Ai2 Releases MolmoWeb2 Web Agents: 27B Model Solves 75.3% of Tasks
- Dec 2, 2026T-Decision-1 9B scores 71.6 points and beats a model six times its size
- Dec 2, 2026JetBrains Releases Air App: Control AI Agents in Your IDE From a Smartphone
- Dec 2, 2026JetBrains Offers Voluntary Departures as IDE Search Raised Agent Task Costs by 6–7%
Key Questions Answered
What are the key details on Union Types and Closed Hierarchies: The Compiler Checks Your Work?
The main new feature in C# 15 is union types. They let you specify in advance which types are allowed for a single value. The announcement's example describes an operation result as a union of two types: a successful response and an error. If you write code that unpacks this result, the compiler makes sure all the variants are handled. Forgetting to handle the error becomes harder. The second new feature follows the same idea: closed class hierarchies.
What are the key details on Faster Build and Runtime, More Library Capabilities?
In the SDK, the precompiled version of the dotnet command-line tool and the MSBuild server are now enabled by default. The server stays running between commands, so repeated operations should run faster. The SDK installation packages for Linux and macOS have been reduced in size by removing duplicate files. The team continued optimizing the Runtime and the JIT compiler. Improvements cover branching, array bounds checks, and interface calls. For Native AOT, the amount of generated code has been reduced.
What the Release Offers for AI Development?
Microsoft singled out AI applications separately. The MCP server template is meant to quickly build a service that AI clients can call for tools: database search, calls to an internal API, and so on. The Microsoft.Extensions.AI library provides a unified set of interfaces for connecting models, so the code is less tied to a specific provider. Microsoft Agent Framework is designed for building agents that use tools, maintain state, and operate within more complex workflows.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
