From da93da88b61a3d139790eae58a68c5fa0eb4cb3f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:25:22 +0000 Subject: [PATCH 1/5] Initial plan From 4ef6dfd2d116d3375df90692353112fffda709a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:30:53 +0000 Subject: [PATCH 2/5] Initial investigation: Found InstallTrackerSingleton import inconsistency Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com> --- sample/yarn.lock | 6 ++-- vscode-dotnet-runtime-extension/yarn.lock | 40 ----------------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/sample/yarn.lock b/sample/yarn.lock index faa426dc30..dbf0615c20 100644 --- a/sample/yarn.lock +++ b/sample/yarn.lock @@ -249,10 +249,10 @@ https-proxy-agent "^7.0.0" tslib "^2.6.2" -"@vscode/vsce-sign-win32-x64@2.0.6": +"@vscode/vsce-sign-linux-x64@2.0.6": version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.6.tgz" - integrity sha1-dEMO/0HSaBjCP5gmsEXYx1cy6us= + resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.6.tgz" + integrity sha1-reEcru7VJPwWvWxDykmuoAKV3ow= "@vscode/vsce-sign@^2.0.0": version "2.0.9" diff --git a/vscode-dotnet-runtime-extension/yarn.lock b/vscode-dotnet-runtime-extension/yarn.lock index 06b25d6294..a51140ada8 100644 --- a/vscode-dotnet-runtime-extension/yarn.lock +++ b/vscode-dotnet-runtime-extension/yarn.lock @@ -488,51 +488,11 @@ ora "^8.1.0" semver "^7.6.2" -"@vscode/vsce-sign-alpine-arm64@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.6.tgz" - integrity sha1-LNJEyvXo7FQ/QvuR1N87kzZByPo= - -"@vscode/vsce-sign-alpine-x64@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.6.tgz" - integrity sha1-sOgKR5IAHGbif+7iwR6CGtH6FoA= - -"@vscode/vsce-sign-darwin-arm64@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.6.tgz" - integrity sha1-S4+hq1XygKmZhb48BvtzDleBDM4= - -"@vscode/vsce-sign-darwin-x64@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-darwin-x64/-/vsce-sign-darwin-x64-2.0.6.tgz" - integrity sha1-0skYbZUFSYJyy93YODuwOOvPWCA= - -"@vscode/vsce-sign-linux-arm@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.6.tgz" - integrity sha1-CifEKkrbN+lu7HjNe/o4jNTp++8= - -"@vscode/vsce-sign-linux-arm64@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.6.tgz" - integrity sha1-s9hWAUQEC5INjG7dQ3QxS1glVIE= - "@vscode/vsce-sign-linux-x64@2.0.6": version "2.0.6" resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.6.tgz" integrity sha1-reEcru7VJPwWvWxDykmuoAKV3ow= -"@vscode/vsce-sign-win32-arm64@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.6.tgz" - integrity sha1-BoiWgUjgPrOSR5yEkcclBnIb7/w= - -"@vscode/vsce-sign-win32-x64@2.0.6": - version "2.0.6" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.6.tgz" - integrity sha1-dEMO/0HSaBjCP5gmsEXYx1cy6us= - "@vscode/vsce-sign@^2.0.0": version "2.0.9" resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign/-/vsce-sign-2.0.9.tgz" From cb21d06e5c6e8cce149d83879f5e323e71cf5b06 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:34:59 +0000 Subject: [PATCH 3/5] Fix: Export InstallTrackerSingleton from library index to maintain singleton pattern Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com> --- vscode-dotnet-runtime-extension/src/extension.ts | 2 +- vscode-dotnet-runtime-library/src/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/vscode-dotnet-runtime-extension/src/extension.ts b/vscode-dotnet-runtime-extension/src/extension.ts index ec8ec502da..82bc3b5c71 100644 --- a/vscode-dotnet-runtime-extension/src/extension.ts +++ b/vscode-dotnet-runtime-extension/src/extension.ts @@ -66,6 +66,7 @@ import IIssueContext, InstallationValidator, InstallRecord, + InstallTrackerSingleton, InvalidUninstallRequest, IUtilityContext, JsonInstaller, @@ -85,7 +86,6 @@ import WebRequestWorkerSingleton, WindowDisplayWorker } from 'vscode-dotnet-runtime-library'; -import { InstallTrackerSingleton } from 'vscode-dotnet-runtime-library/dist/Acquisition/InstallTrackerSingleton'; import { dotnetCoreAcquisitionExtensionId } from './DotnetCoreAcquisitionId'; import open = require('open'); diff --git a/vscode-dotnet-runtime-library/src/index.ts b/vscode-dotnet-runtime-library/src/index.ts index cd5af02f4e..403b9e17c9 100644 --- a/vscode-dotnet-runtime-library/src/index.ts +++ b/vscode-dotnet-runtime-library/src/index.ts @@ -25,6 +25,7 @@ export * from './Acquisition/IJsonInstaller'; export * from './Acquisition/InstallationValidator'; export * from './Acquisition/InstallRecord'; export * from './Acquisition/InstallRecordWithPath'; +export * from './Acquisition/InstallTrackerSingleton'; export * from './Acquisition/IVersionResolver'; export * from './Acquisition/JsonInstaller'; export * from './Acquisition/LinuxGlobalInstaller'; From 52a093af1aca659ec464cf027783a67131d83ff6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:43:40 +0000 Subject: [PATCH 4/5] Fix: Also update SDK extension to use library exports instead of dist imports Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com> --- vscode-dotnet-sdk-extension/src/extension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vscode-dotnet-sdk-extension/src/extension.ts b/vscode-dotnet-sdk-extension/src/extension.ts index 50da6aa889..8ff06dd01c 100644 --- a/vscode-dotnet-sdk-extension/src/extension.ts +++ b/vscode-dotnet-sdk-extension/src/extension.ts @@ -22,6 +22,8 @@ import EventBasedError, ExtensionConfigurationWorker, formatIssueUrl, + GlobalInstallerResolver, + IAcquisitionWorkerContext, IDotnetAcquireContext, IDotnetUninstallContext, IEventStreamContext, @@ -38,8 +40,6 @@ import } from 'vscode-dotnet-runtime-library'; import open = require('open'); -import { GlobalInstallerResolver } from 'vscode-dotnet-runtime-library/dist/Acquisition/GlobalInstallerResolver'; -import { IAcquisitionWorkerContext } from 'vscode-dotnet-runtime-library/dist/Acquisition/IAcquisitionWorkerContext'; import { dotnetCoreAcquisitionExtensionId } from './DotnetCoreAcquisitionId'; const packageJson = require('../package.json'); From a0c20a9686bba9483a3503e20ceb29c8fb42b728 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 18:21:18 +0000 Subject: [PATCH 5/5] Fix: Add error handling for mutex failures in markInstallAsInUse Handle mutex acquisition failures gracefully when marking installations as in use. If the mutex can't be acquired (e.g., due to temp folder permission issues), log the error but don't fail the entire findPath operation. This prevents the C# debug adapter from failing when mutex operations encounter issues. Addresses feedback that mutex implementation in v2.3.2 could cause failures in environments with restricted temp folder access. Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com> --- .../src/extension.ts | 25 +++++++++++++++++-- .../src/EventStream/EventStreamEvents.ts | 10 ++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/vscode-dotnet-runtime-extension/src/extension.ts b/vscode-dotnet-runtime-extension/src/extension.ts index 82bc3b5c71..0cc8c99e11 100644 --- a/vscode-dotnet-runtime-extension/src/extension.ts +++ b/vscode-dotnet-runtime-extension/src/extension.ts @@ -73,6 +73,7 @@ import LinuxVersionResolver, LocalInstallUpdateService, LocalMemoryCacheSingleton, + MarkInstallAsInUseFailedEvent, NoExtensionIdProvided, registerEventStream, UninstallErrorConfiguration, @@ -504,7 +505,17 @@ export function activate(vsCodeContext: vscode.ExtensionContext, extensionContex if ((installs?.length ?? 0) > 0) { - await InstallTrackerSingleton.getInstance(globalEventStream, vsCodeContext.globalState).markInstallAsInUse(dotnetExecutablePath); + try + { + await InstallTrackerSingleton.getInstance(globalEventStream, vsCodeContext.globalState).markInstallAsInUse(dotnetExecutablePath); + } + catch (error: any) + { + // Log but don't fail if we can't mark the install as in use (e.g., due to mutex/temp folder issues) + // This is a non-critical operation that shouldn't prevent the extension from finding and using the .NET installation + globalEventStream.post(new MarkInstallAsInUseFailedEvent( + `Failed to mark install as in use: ${error?.message ?? JSON.stringify(error)}. Continuing anyway.`)); + } } return installs ?? []; @@ -738,7 +749,17 @@ ${JSON.stringify(commandContext)}`)); if (validated) { globalEventStream.post(new DotnetFindPathMetCondition(`${path} met the conditions.`)); - await InstallTrackerSingleton.getInstance(globalEventStream, vsCodeContext.globalState).markInstallAsInUse(path); + try + { + await InstallTrackerSingleton.getInstance(globalEventStream, vsCodeContext.globalState).markInstallAsInUse(path); + } + catch (error: any) + { + // Log but don't fail if we can't mark the install as in use (e.g., due to mutex/temp folder issues) + // This is a non-critical operation that shouldn't prevent the extension from finding and using the .NET installation + globalEventStream.post(new MarkInstallAsInUseFailedEvent( + `Failed to mark install as in use: ${error?.message ?? JSON.stringify(error)}. Continuing anyway.`)); + } return path; } } diff --git a/vscode-dotnet-runtime-library/src/EventStream/EventStreamEvents.ts b/vscode-dotnet-runtime-library/src/EventStream/EventStreamEvents.ts index 58662a2344..784e495293 100644 --- a/vscode-dotnet-runtime-library/src/EventStream/EventStreamEvents.ts +++ b/vscode-dotnet-runtime-library/src/EventStream/EventStreamEvents.ts @@ -1701,6 +1701,16 @@ export class DotnetOfflineWarning extends DotnetCustomMessageEvent } } +export class MarkInstallAsInUseFailedEvent extends DotnetCustomMessageEvent +{ + public readonly eventName = 'MarkInstallAsInUseFailedEvent'; + constructor(eventMsg: string) + { + super(eventMsg); + this.type = EventType.DotnetAcquisitionMessage; + } +} + export class NetInstallerBeginExecutionEvent extends DotnetCustomMessageEvent { public readonly eventName = 'NetInstallerBeginExecutionEvent';