Problem
When C# Dev Kit owns workspace SDK selection through Workspace Requirements, the C# extension still independently runs dotnet --info against its own configured paths/ambient PATH during debugger activation.
In a Remote SSH Linux workspace with no ambient dotnet on PATH, this produces two competing remediations at once:
- C# Dev Kit opens Workspace Requirements with Install .NET 10 SDK.
- The C# extension shows The .NET SDK cannot be located with Get the SDK.
The C# notification is especially confusing because its Get the SDK action already delegates to csdevkit.installDotnetSdk when C# Dev Kit is present, while the prerequisite check that raised it did not use C# Dev Kit's selected host or blocked state.
Observed with:
- C# Dev Kit
9.9.554-g91f1bb
- C#
2.140.9
- VS Code Remote SSH to Ubuntu 24.04 x64
- no ambient
dotnet on the remote PATH
Relevant current code:
src/coreclrDebug/util.ts: checkDotNetCli() runs dotnet --info using C# extension paths.
src/coreclrDebug/activate.ts: showDotnetToolsWarning() routes Get the SDK to csdevkit.installDotnetSdk when Dev Kit is present.
src/utils/getCSharpDevKit.ts and src/csharpDevKitExports.ts: C# already discovers and consumes C# Dev Kit exports, but there is no selected workspace host/readiness contract.
Expected behavior
C# Dev Kit should be the single SDK/host authority when it is active and dotnet.preferCSharpExtension is not selected:
- C# obtains the exact workspace
dotnet executable and environment selected by C# Dev Kit before debugger prerequisite checks.
- If Workspace Requirements is blocked and has opened its remediation UI, C# does not show a second SDK-install notification.
- After the user installs or selects the SDK and reloads, both extensions use the same host.
- When C# Dev Kit is absent or explicitly bypassed, C# retains its current standalone discovery and notification behavior.
A minimal contract could be an optional C# Dev Kit export returning { status: ready | blocked, dotnetPath?, environment? }. Because workspace host changes are already reload-bound, this does not require live language-server/debugger host switching.
Related
Problem
When C# Dev Kit owns workspace SDK selection through Workspace Requirements, the C# extension still independently runs
dotnet --infoagainst its own configured paths/ambientPATHduring debugger activation.In a Remote SSH Linux workspace with no ambient
dotnetonPATH, this produces two competing remediations at once:The C# notification is especially confusing because its Get the SDK action already delegates to
csdevkit.installDotnetSdkwhen C# Dev Kit is present, while the prerequisite check that raised it did not use C# Dev Kit's selected host or blocked state.Observed with:
9.9.554-g91f1bb2.140.9dotneton the remotePATHRelevant current code:
src/coreclrDebug/util.ts:checkDotNetCli()runsdotnet --infousing C# extension paths.src/coreclrDebug/activate.ts:showDotnetToolsWarning()routes Get the SDK tocsdevkit.installDotnetSdkwhen Dev Kit is present.src/utils/getCSharpDevKit.tsandsrc/csharpDevKitExports.ts: C# already discovers and consumes C# Dev Kit exports, but there is no selected workspace host/readiness contract.Expected behavior
C# Dev Kit should be the single SDK/host authority when it is active and
dotnet.preferCSharpExtensionis not selected:dotnetexecutable and environment selected by C# Dev Kit before debugger prerequisite checks.A minimal contract could be an optional C# Dev Kit export returning
{ status: ready | blocked, dotnetPath?, environment? }. Because workspace host changes are already reload-bound, this does not require live language-server/debugger host switching.Related
dotnet.dotnetPathset by C# extension microsoft/vscode-dotnettools#792