Implicit using directives
Context: Implicit using directives automatically import common namespaces. They are enabled by default in .NET 10 projects.
When using top-level statements (or setting ImplicitUsings in .csproj), common namespaces are automatically imported.
Default Implicit Usings
Section titled “Default Implicit Usings”| SDK Type | Implicit Usings |
|---|---|
| Microsoft.NET.Sdk | System, System.Collections.Generic, System.IO, System.Linq, System.Net.Http, System.Threading, System.Threading.Tasks |
| Microsoft.NET.Sdk.Web | Plus ASP.NET Core namespaces |
| Microsoft.NET.Sdk.Worker | Plus background service namespaces |
Configuration
Section titled “Configuration”In .csproj:
<PropertyGroup> <ImplicitUsings>enable</ImplicitUsings></PropertyGroup>Disable Implicit Usings
Section titled “Disable Implicit Usings”<PropertyGroup> <ImplicitUsings>disable</ImplicitUsings></PropertyGroup>Global Usings
Section titled “Global Usings”Create GlobalUsings.cs:
global using System.Text.Json;global using MyApp.Common;