Skip to content

(WIP) Add support for global runtime and ASP.NET Core installation#2573

Open
JakeRadMSFT wants to merge 1 commit intodotnet:mainfrom
JakeRadMSFT:feature/global-runtime-install
Open

(WIP) Add support for global runtime and ASP.NET Core installation#2573
JakeRadMSFT wants to merge 1 commit intodotnet:mainfrom
JakeRadMSFT:feature/global-runtime-install

Conversation

@JakeRadMSFT
Copy link
Member

@JakeRadMSFT JakeRadMSFT commented Feb 18, 2026

(Written by Copilot) Just wanted to try and understand the needed changes.

Summary

Generalizes the global SDK installation infrastructure to also support installing .NET runtimes and ASP.NET Core runtimes globally via a new dotnet.acquireGlobalRuntime command.

Motivation

Extensions like C# Dev Kit need to acquire .NET runtimes globally when a workspace's \global.json\ requires a newer SDK version than the extension's bundled tooling runtime. Currently, only \dotnet.acquireGlobalSDK\ supports global installation. This PR adds the equivalent capability for runtimes and ASP.NET Core runtimes.

Changes

Library (\�scode-dotnet-runtime-library)

  • **\GlobalInstallerResolver**: Accept \DotnetInstallMode\ parameter to resolve runtime/aspnetcore installer URLs from the releases JSON (previously hardcoded to SDK)
  • **\IGlobalInstaller**: Add \installGlobal()/\uninstallGlobal()/\getExpectedGlobalDotnetPath()\ with backward-compatible default implementations that delegate to existing SDK methods
  • **\LinuxGlobalInstaller**: Accept mode parameter, use generalized \ValidateAndInstall/\Uninstall\ methods
  • **\LinuxVersionResolver**: Add generalized \ValidateAndInstall(version, mode)/\Uninstall(version, mode)\ methods (existing SDK methods now delegate to these)
  • **\WinMacGlobalInstaller**: Accept mode parameter, skip SDK-specific Windows conflict check for runtime installs, handle mode-specific uninstall directories on macOS
  • **\DotnetCoreAcquisitionWorker**: Add \�cquireGlobalRuntime()/\�cquireGlobalASPNET()\ methods, pass mode to installer constructors, use generalized install methods in \�cquireGlobalCore\
  • **\IDotnetCoreAcquisitionWorker**: Add \�cquireGlobalRuntime/\�cquireGlobalASPNET\ interface methods

Extension (\�scode-dotnet-runtime-extension)

  • Register \dotnet.acquireGlobalRuntime\ command supporting both
    untime\ and \�spnetcore\ modes (via \commandContext.mode)

API Usage

\\ ypescript
// Install a .NET runtime globally
const result = await vscode.commands.executeCommand('dotnet.acquireGlobalRuntime', {
version: '9.0.0',
requestingExtensionId: 'ms-dotnettools.csdevkit',
mode: 'runtime', // or 'aspnetcore'
installType: 'global'
});
\\

Backward Compatibility

  • All existing SDK methods (\installSDK, \uninstallSDK, \getExpectedGlobalSDKPath) are preserved and now delegate to the new generalized methods
  • \GlobalInstallerResolver\ defaults to 'sdk'\ mode when no mode is specified
  • No breaking changes to existing API contracts

Generalize the global SDK installation infrastructure to also support
installing .NET runtimes and ASP.NET Core runtimes globally. This enables
extensions like C# Dev Kit to request global runtime installs when a
workspace's global.json requires a newer SDK version.

Changes:
- GlobalInstallerResolver: Accept DotnetInstallMode to resolve runtime/
  aspnetcore installer URLs from the releases JSON (not just SDK)
- IGlobalInstaller: Add installGlobal/uninstallGlobal/getExpectedGlobalDotnetPath
  with backward-compatible defaults delegating to existing SDK methods
- LinuxGlobalInstaller: Accept mode, use generalized ValidateAndInstall/Uninstall
- LinuxVersionResolver: Add generalized ValidateAndInstall/Uninstall methods
- WinMacGlobalInstaller: Accept mode, skip SDK-specific conflict check for
  runtimes, handle mode-specific uninstall directories on macOS
- DotnetCoreAcquisitionWorker: Add acquireGlobalRuntime/acquireGlobalASPNET,
  pass mode to installer constructors, use generalized install methods
- IDotnetCoreAcquisitionWorker: Add interface methods for global runtime/ASPNET
- Extension: Register dotnet.acquireGlobalRuntime command supporting both
  runtime and aspnetcore modes
@JakeRadMSFT JakeRadMSFT changed the title Add support for global runtime and ASP.NET Core installation (WIP) Add support for global runtime and ASP.NET Core installation Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments