Skip to content

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.

SDK TypeImplicit Usings
Microsoft.NET.SdkSystem, System.Collections.Generic, System.IO, System.Linq, System.Net.Http, System.Threading, System.Threading.Tasks
Microsoft.NET.Sdk.WebPlus ASP.NET Core namespaces
Microsoft.NET.Sdk.WorkerPlus background service namespaces

In .csproj:

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

Create GlobalUsings.cs:

global using System.Text.Json;
global using MyApp.Common;