Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sample/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 24 additions & 3 deletions vscode-dotnet-runtime-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ import
IIssueContext,
InstallationValidator,
InstallRecord,
InstallTrackerSingleton,
InvalidUninstallRequest,
IUtilityContext,
JsonInstaller,
LinuxVersionResolver,
LocalInstallUpdateService,
LocalMemoryCacheSingleton,
MarkInstallAsInUseFailedEvent,
NoExtensionIdProvided,
registerEventStream,
UninstallErrorConfiguration,
Expand All @@ -85,7 +87,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');

Expand Down Expand Up @@ -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 ?? [];
Expand Down Expand Up @@ -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;
}
}
Expand Down
40 changes: 0 additions & 40 deletions vscode-dotnet-runtime-extension/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vscode-dotnet-runtime-library/src/EventStream/EventStreamEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions vscode-dotnet-runtime-library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions vscode-dotnet-sdk-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import
EventBasedError,
ExtensionConfigurationWorker,
formatIssueUrl,
GlobalInstallerResolver,
IAcquisitionWorkerContext,
IDotnetAcquireContext,
IDotnetUninstallContext,
IEventStreamContext,
Expand All @@ -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');
Expand Down
Loading