Feature request
Please add a workspace setting such as dotnet.defaultGlobalJson, analogous to the existing dotnet.defaultSolution setting.
This setting should allow a repository to identify the global.json that controls its .NET SDK and test-runner context when that file is located in a subdirectory rather than at the workspace root.
Proposed behavior
When dotnet.defaultGlobalJson is configured, C# Dev Kit should use that file when initializing the workspace context for:
- the language server
- project and solution loading
- Test Explorer test discovery and execution
The setting should support a workspace-relative path, for example:
{
"dotnet.defaultSolution": "dotnet/agent-framework-release.slnf",
"dotnet.defaultGlobalJson": "dotnet/global.json"
}
The explicit setting should take precedence over automatic global.json discovery for the affected workspace context. Existing automatic discovery should remain unchanged when the setting is absent.
Scenario
A repository may contain multiple language and tooling areas and keep its .NET configuration under a dotnet/ subdirectory. In this layout, the workspace root may contain the solution filter at dotnet/agent-framework-release.slnf and the SDK/test configuration at dotnet/global.json.
For example, the repository where this was observed has a dotnet/global.json selecting Microsoft Testing Platform, while its test projects use UseMicrosoftTestingPlatformRunner=true. Direct MTP discovery finds the tests when run from the dotnet directory, but opening the repository root provides no way to explicitly select the nested global.json context for the language server and Test Explorer.
Acceptance criteria
- Add and document
dotnet.defaultGlobalJson.
- Honor it when loading the language-server workspace context.
- Honor it during Test Explorer discovery and test execution.
- Preserve current automatic discovery when the setting is absent.
- Report a clear diagnostic when the configured path does not exist or is invalid.
Feature request
Please add a workspace setting such as
dotnet.defaultGlobalJson, analogous to the existingdotnet.defaultSolutionsetting.This setting should allow a repository to identify the
global.jsonthat controls its .NET SDK and test-runner context when that file is located in a subdirectory rather than at the workspace root.Proposed behavior
When
dotnet.defaultGlobalJsonis configured, C# Dev Kit should use that file when initializing the workspace context for:The setting should support a workspace-relative path, for example:
{ "dotnet.defaultSolution": "dotnet/agent-framework-release.slnf", "dotnet.defaultGlobalJson": "dotnet/global.json" }The explicit setting should take precedence over automatic
global.jsondiscovery for the affected workspace context. Existing automatic discovery should remain unchanged when the setting is absent.Scenario
A repository may contain multiple language and tooling areas and keep its .NET configuration under a
dotnet/subdirectory. In this layout, the workspace root may contain the solution filter atdotnet/agent-framework-release.slnfand the SDK/test configuration atdotnet/global.json.For example, the repository where this was observed has a
dotnet/global.jsonselecting Microsoft Testing Platform, while its test projects useUseMicrosoftTestingPlatformRunner=true. Direct MTP discovery finds the tests when run from thedotnetdirectory, but opening the repository root provides no way to explicitly select the nestedglobal.jsoncontext for the language server and Test Explorer.Acceptance criteria
dotnet.defaultGlobalJson.