GlobalUsingsAnalyzer 1.4.0

dotnet add package GlobalUsingsAnalyzer --version 1.4.0
NuGet\Install-Package GlobalUsingsAnalyzer -Version 1.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GlobalUsingsAnalyzer" Version="1.4.0">
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GlobalUsingsAnalyzer --version 1.4.0
#r "nuget: GlobalUsingsAnalyzer, 1.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GlobalUsingsAnalyzer as a Cake Addin
#addin nuget:?package=GlobalUsingsAnalyzer&version=1.4.0

// Install GlobalUsingsAnalyzer as a Cake Tool
#tool nuget:?package=GlobalUsingsAnalyzer&version=1.4.0

Global usings analyzer

A C# analyzer that will suggest moving usings to a single project file. Defaults to GlobalUsings.cs

To change the name of the file (defaults to GlobalUsings.cs) add the following .editorconfig setting:

dotnet_diagnostic.GlobalUsingsAnalyzer0001.filename = FILENAME.cs

To disable the analyzer for a project/solution add the following .edtiorconfig setting:

dotnet_diagnostic.GlobalUsingsAnalyzer0002.enabled = false

To change the severity of the diagnostic per project/solution add the following .edtiorconfig setting:

dotnet_diagnostic.GlobalUsingsAnalyzer0003.severity = error (can be info, warning, error or hidden)

Note: The diagnostics must be placed under the [*.cs] entry to work

Also available as a NuGet package for per-project installs: GlobalUsingsAnalyzer

Release Notes


  • Fixed a bug where diagnostic severity would not be set.


  • Fixed a bug where moving usings would move preceeding comments/directives.


  • Fixed a bug where the directory structure was wrong in Mac/Linux.


  • Changed name of filename setting to dotnet_diagnostic.GlobalUsingsAnalyzer0001.filename
  • Do not report issues when C# version is lower than C# 10 (first version to support Global Usings)
  • Added new setting dotnet_diagnostic.GlobalUsingsAnalyzer0002.enabled used to disable the analyzer for a specific project/solution
  • Added new setting dotnet_diagnostic.GlobalUsingsAnalyzer0003.diagnostic_severity used to control the severity of the diagnostic. Can be one of the following: error, info, warning, hidden


Initial release

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 3,613 2/21/2023
1.3.0 502 2/8/2023
1.2.0 245 1/24/2023
1.1.0 295 11/20/2022
1.0.1 3,216 7/10/2022
1.0.0 318 7/10/2022

Initial release.