Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code should disable/deactivate extensions before uninstalling them to prevent uninstall from failing #26828

Closed
sean-mcmanus opened this issue May 17, 2017 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

  • VSCode Version: 1.12.2 (I think all)
  • OS Version: Windows (I think all)

Steps to Reproduce:

  1. Install the C++/cpptools extension or any other extension that runs a binary from the extension folder.
  2. Make sure the Microsoft.VSCode.CPP.Extension process is running (i.e. open a C++ file).
  3. Uninstall the extension.

Bug: No "Reload/Install" button appears, because the VS Code uninstaller tries to delete the running extension process while it's still running (so the process never gets removed until VS Code is restarted). The process continues to run because our extension gets no deactivate message. Doing a Reload Window causes the extension to appear uninstalled in the Extensions window, but when you click the Install button it gives the error "Please restart Code before reinstalling C/C++".

Workaround: Doing a Disable/Reload before the Uninstall prevents the error. It would be great if VS Code would do this automatically.

@dlech
Copy link
Contributor

dlech commented Aug 16, 2017

I have this issue with an extension I am developing as well.

@deltaz0
Copy link

deltaz0 commented Oct 31, 2017

For those who just want to fix the "please restart code before reinstalling X" issue:

  1. Restart computer.
  2. Delete ~/.vscode/extensions/(folderOfProblemExtension)
  3. Run vscode, you should now be able to install the extension.

@joaomoreno joaomoreno assigned sandy081 and unassigned joaomoreno Nov 1, 2017
@guw
Copy link
Contributor

guw commented Nov 15, 2017

FWIW, we are getting similar reports from users for our extension. Sometimes the error seems to be caused by an ongoing auto-update functionality.

@jburger
Copy link

jburger commented Dec 2, 2017

I also encountered this issue today with the C++ extension.

You can workaround this without a reboot by closing code, then using procexp (sysinternals process explorer) to find handles on files in the extension directory. Kill any processes associated with those handles and you're all good to remove the extension folder and start vscode back up again.

I think I had a running intellisense process after VS Code had shutdown and that was what required nuking from orbit.

@sean-mcmanus
Copy link
Contributor Author

Oh, recently, I've just been doing a Close Folder before uninstalling the cpptools extension (e.g. when we need to test a newer internal VSIX).

@peacefulseeker
Copy link

Thanks @deltaz0,

was enough just with deleting extension folder. =)

@sandy081
Copy link
Member

@sean-mcmanus Please revalidate this issue with latest insiders. We no longer delete the folder while uninstalling an extension. We just mark it as uninstalled. Extension will not be loaded in the next reload and the extension folder is deleted in the next restart of VS Code.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions
Projects
None yet
Development

No branches or pull requests

9 participants