Change:
VS Code Version: stable 1.74.0 OS Version: Windows 11 Build .900 Feature: Settings Profiles (Profiles) When certain Extensions that I had disabled for the active profile automatically update, they get re-inserted (re-enabled) in my Extensions list for that profile, and will remain there from that point onwards. I've noticed this with all the "C++" extensions from Microsoft, as well as the "Remote Explorer", and "Remote - SSH" also from Microsoft, but this might be happening with other extensions as well. Even if I disable them again for that profile, they'll come back the next time they update Steps to Reproduce: Profiles feature by setting the to true. the C++ from Microsoft on the default profile. a new profile "A" other than default, disable the C++ extension. a second profile "B" but enable the C++ extension. a third profile "C" following step 2. to either A or C profile. vscode, reopen it on the same folder, and wait for the C++ extension to update (I'm not aware of any means to force an extension update besides creating one myself). You'll notice that once the C++ extension update, it will re-enable automatically on both profiles A and C, and will remain there even after re-starting vscode, until you disable it again. In which case it will reappear again once it updates.
How did you force the extension update? Can you please share your profiles (you can use profile export feature) so that I can reproduce?
Hi as mentioned in the issue, I did not force the update since I'm not aware of any means to do that, I just waited for extensions to update. By the way I also noticed this happening with a non-Microsoft extension called "Better C++ Syntax" How can I share the profiles with you in a non-public manner?
You can export the profile to a file or github gist and share it with me via email -
Done. Hope that can solve it since it keeps happening. Thank you
Why is this still labelled as info-needed?
is there a way to simulate the extension update that is needed to reproduce the issue?
Yeah there is, but its a lengthy one: Please open extensions installation folder and the folder where profiles are stored that is user data folder/User/profiles Quit VS Code Change the name of the extension in the extensions installation folder and also the version in the Update the name and version in file in all profiles include the file in extension installation folder.

Discussion:
this.extensionsManager = this._register(instantiationService.createInstance(ExtensionsManager)); this.extensionsManager.whenInitialized().then(() => { if (!isDisposed) { <del> this._register(this.extensionsManager.onDidChangeExtensions(({ added, removed }) => this._onDidChangeExtensions(added, removed))); </del> <ins> this._register(this.extensionsManager.onDidChangeExtensions(({ added, removed, isProfileSwitch }) => this._onDidChangeExtensions(added, removed, isProfileSwitch))); </ins> uninstallDisposable.dispose(); } });

} } <del> private _onDidChangeExtensions(added: ReadonlyArray<IExtension>, removed: ReadonlyArray<IExtension>): void { </del> <ins> private _onDidChangeExtensions(added: ReadonlyArray<IExtension>, removed: ReadonlyArray<IExtension>, isProfileSwitch: boolean): void { </ins> const disabledExtensions = added.filter(e => !this.isEnabledEnablementState(this.getEnablementState(e))); if (disabledExtensions.length) { this._onEnablementChanged.fire(disabledExtensions); } <del> removed.forEach(({ identifier }) => this._reset(identifier)); </del> <ins> if (!isProfileSwitch) { removed.forEach(({ identifier }) => this._reset(identifier)); } </ins> } public async updateExtensionsEnablementsWhenWorkspaceTrustChanges(): Promise<void> {

private _extensions: IExtension[] = []; get extensions(): readonly IExtension[] { return this._extensions; } <del> private _onDidChangeExtensions = this._register(new Emitter<{ added: readonly IExtension[]; removed: readonly IExtension[] }>()); </del> <ins> private _onDidChangeExtensions = this._register(new Emitter<{ added: readonly IExtension[]; removed: readonly IExtension[]; readonly isProfileSwitch: boolean }>()); </ins> readonly onDidChangeExtensions = this._onDidChangeExtensions.event; private readonly initializePromise;

if (this.disposed) { return; } <del> this._onDidChangeExtensions.fire({ added: this.extensions, removed: [] }); </del> <ins> this._onDidChangeExtensions.fire({ added: this.extensions, removed: [], isProfileSwitch: false }); </ins> } catch (error) { this.logService.error(error); } <del> this._register(this.extensionManagementService.onDidInstallExtensions(e => this.onDidInstallExtensions(e.reduce<IExtension[]>((result, { local, operation }) => { if (local && operation !== InstallOperation.Migrate) { result.push(local); } return result; }, [])))); this._register(Event.filter(this.extensionManagementService.onDidUninstallExtension, (e => !e.error))(e => this.onDidUninstallExtensions([e.identifier], e.server))); this._register(this.extensionManagementService.onDidChangeProfile(({ added, removed, server }) => { this.onDidInstallExtensions(added); this.onDidUninstallExtensions(removed.map(({ identifier }) => identifier), server); })); </del> <ins> this._register(this.extensionManagementService.onDidInstallExtensions(e => this.updateExtensions(e.reduce<IExtension[]>((result, { local, operation }) => { if (local && operation !== InstallOperation.Migrate) { result.push(local); } return result; }, []), [], undefined, false))); this._register(Event.filter(this.extensionManagementService.onDidUninstallExtension, (e => !e.error))(e => this.updateExtensions([], [e.identifier], e.server, false))); this._register(this.extensionManagementService.onDidChangeProfile(({ added, removed, server }) => { this.updateExtensions(added, removed.map(({ identifier }) => identifier), server, true); })); </ins> } <del> private onDidInstallExtensions(extensions: IExtension[]): void { if (extensions.length) { this._extensions.push(...extensions); this._onDidChangeExtensions.fire({ added: extensions, removed: [] }); </del> <ins> private updateExtensions(added: IExtension[], identifiers: IExtensionIdentifier[], server: IExtensionManagementServer | undefined, isProfileSwitch: boolean): void { if (added.length) { this._extensions.push(...added); </ins> } <del> } private onDidUninstallExtensions(identifiers: IExtensionIdentifier[], server: IExtensionManagementServer): void { </del> const removed: IExtension[] = []; for (const identifier of identifiers) { const index = this._extensions.findIndex(e => areSameExtensions(e.identifier, identifier) && this.extensionManagementServerService.getExtensionManagementServer(e) === server);

removed.push(...this._extensions.splice(index, 1)); } } <del> if (removed.length) { this._onDidChangeExtensions.fire({ added: [], removed }); </del> <ins> if (added.length || removed.length) { this._onDidChangeExtensions.fire({ added, removed, isProfileSwitch }); </ins> } } }