Proj6010: global.json should exist

To ensure a predictable .NET SDK version is used across different machines, CI/CD pipelines, and local development environments, a global.json file should exist for every MSBuild project.

When a global.json file is missing, the .NET CLI and MSBuild will resolve to the latest installed .NET SDK version on the compiling host machine. This can introduce subtle bugs, build failures, or differences in compiler diagnostics if developers have different SDK versions installed.

Non-compliant

No global.json file is present in the project directory or any parent directories up to the repository root.

Compliant

A global.json file is defined at the project directory level or in a parent directory, specifying the .NET SDK version:

{
  "sdk": {
    "version": "10.0.400",
    "rollForward": "latestPatch"
  }
}