The .NET 11 SDK brings smaller installers, refined analyzers, a much more convenient CLI and important changes for testing, containers, MSBuild and NuGet. This article summarizes the official page and ends with instructions for upgrading your SDK.
SDK footprint
On Linux and macOS, duplicate assemblies (.dll and .exe files with the same hash) are replaced with symbolic links to a single copy, for tarballs, .pkg, .deb and .rpm. According to the source, an early build had 35% of the SDK directory duplicated; on linux-x64 the tarball goes from 230 to 189 MB (-17.8%), the deb from 164 to 122 MB (-25.6%), the rpm from 165 to 122 MB (-26.0%), and containers save 8-17%. Crossgen is also skipped for assemblies that exist only under DotnetTools/, saving another 23.6 MB. Windows deduplication is not included.
Analyzers and warnings
- CA1873 (potentially expensive logging) has fewer false positives: property accesses,
GetType(),GetHashCode()andGetTimestamp()are no longer flagged, and by default only Information level and below is checked. The message now states the reason (method invocation, object or array creation, boxing, string interpolation, collection expression, anonymous object, await, with expression). - Fixes: CA1515 and CA1034 no longer misfire with C# extension members; CA1859 handles default interface implementations;
AnalysisLevel=latestwrongly used .NET 9 rules and now uses .NET 11 rules. - NETSDK1235: a warning when a project with
PackAsTool=truesets a customNuspecFile; packing still proceeds.
Command-line productivity
- Solution filters:
dotnet new slnf --parent-solution MySolution.slnx --name Tests, thendotnet sln Tests.slnf add|list|remove. - File-based apps across files: the
#:includedirective (also for DLLs, mapped toReferenceitems, with no feature flag);#:sdk,#:propertyand#:packagemay appear duplicated across included files when the values match.#:propertyaccepts quoted values;#:package,#:projectand#:refaccept trailingName=Valuemetadata tokens (for exampleAliases=CommandLine). A:is no longer allowed in property names. - Native AOT for file-based apps:
dotnet run --file app.cs,dotnet run app.csanddotnet app.cscan reuse existing build outputs;dotnet format app.csworks; with the artifacts layout, outputs go to the repository's artifacts folder. - dotnet run -e:
dotnet run -e ASPNETCORE_ENVIRONMENT=Development -e LOG_LEVEL=Debugpasses environment variables, visible to MSBuild asRuntimeEnvironmentVariableitems; MSBuild properties in launch-profilecommandLineArgsare expanded; the "Using launch settings from..." notice goes to stderr. - dotnet watch: Aspire app host integration, automatic relaunch after a crash, better Ctrl+C for Windows Forms and WPF, device selection for MAUI and mobile (
dotnet watch --device <device-id>), browser refresh for static SSR pages in Blazor Web apps, and several long-standing bugs fixed. iOS Simulator projects need<MtouchLink>None</MtouchLink>. - dotnet reference:
addandremovefall back to the current directory without--projectand support file-based apps (dotnet reference add --file app.cs). - More: static fish shell completions;
dotnet formatlimits.editorconfigdiscovery to included files (one benchmark went from 1.09 to 0.55 seconds) and accepts--framework;dotnet testin MTP mode supports--artifacts-path;dotnet tool execanddnxno longer ask for an extra approval;dotnet new install --prerelease; theConfigurationenvironment variable supplies the default for-c; concurrent tool installs no longer race.
CLI architecture and telemetry
- NativeAOT entry point: enabled by default (opt out with
DOTNET_CLI_ENABLEAOT=false). Commands such asdotnet --version,--info,--help,--cli-schemaanddotnet sln list/migrate/removerun natively; everything else falls back to the managed CLI. Tools and external commands such asdotnet efordotnet dev-certslaunch out of process, skipping the 600-700 ms managed startup. - MSBuild server: on by default; opt out with
DOTNET_CLI_USE_MSBUILD_SERVER=falseorMSBUILDUSESERVER=0. When the former is unset, the CLI no longer forcesMSBUILDUSESERVER=0. - OpenTelemetry telemetry: replaces Application Insights with Azure Monitor and OTLP exporters; behavior and the
DOTNET_CLI_TELEMETRY_OPTOUTopt-out are unchanged. The OTLP exporter also turns on when standardOTEL_EXPORTER_OTLP_*variables are present. - Optimized Native AOT publish: opt-in by setting both
PublishAotandUseOptimizedPublishto true; the source says it becomes the default from .NET 12 Preview 1. - Partial Ready-to-Run: an MSBuild property meant for mobile workloads (macios, MAUI), not for apps.
- Static Web Assets: Asset Groups,
AdditionalEndpointDefinitionsand TypeScript output integration.
dotnet test
- MTP options:
--no-dependencies, theDOTNET_TEST_RUNNERvariable (VSTest or Microsoft.Testing.Platform),--use-current-runtime/--ucr,!exclusions in--test-modules, per-assembly counts,--tlforwarding, live in-flight tests, two-stage Ctrl+C, live output with protocol 1.1.0. - Mobile testing: Android, iOS, macOS and Mac Catalyst with
--deviceand theandroidtest,iostest,macostest,maccatalysttesttemplates (MSTest by default);dotnet test -blrecords everything in one binary log. - Run-level policies:
--timeout 90s(exit code 3),--maximum-failed-tests 5(exit code 13),--results-directory-layout per-module, default artifacts layout and--nologo. - Experimental: affected-test selection with
--collect-test-mapand--affected-tests, through a separate extension andDOTNET_CLI_ENABLE_AFFECTED_TESTS=1. - More: traversal projects (
dotnet test dirs.proj), better reporters,dotnet new xunit --xunit-version v3anddotnet new nunit --test-runner Microsoft.Testing.Platform.
MSBuild, NuGet and containers
- Faster wildcards: with SDK 11.0.100 or Visual Studio 18.12, full evaluations are 10-13% faster with 16-34% fewer allocations (on four measured workloads).
- NuGet:
--min-publish-age-hoursfordotnet nuget add sourceandupdate source;dotnet package add/updateapply it; for floating references, restore fails with NU1020. - Containers: multi-arch builds with Podman, platform-native local runtimes preferred (
wslcon Windows,containeron macOS), reproducible publishing withSOURCE_DATE_EPOCHand an existing-manifest check (ContainerPushNoCache=truebypasses it).
Upgrading your SDK
.NET 11 is generally available. To install or upgrade the SDK, use these official pages, all verified with an HTTP request:
- Download .NET 11
- All .NET downloads
- Release notes on GitHub (dotnet/core)
- .NET MAUI installation for mobile workloads
After installing, check the version with dotnet --version and, if you use a global.json, update it accordingly.
Sources
- What's new in the SDK and tooling for .NET 11 (Microsoft Learn)
- What's new in .NET 11 (Microsoft Learn)
Comments (0)
No comments yet.