169

Since the latest release of VS Code, I get an error whenever I open a C# file (I have installed the csharp language extension, powered by OmniSharp). This is the error I get:

enter image description here

I tried uninstalling the extension and re-install it, same problem. I uninstalled the application altogether and reinstalled it - but when I do that, my extensions are still installed (for instance Python and reStructuredText were still there). I uninstalled yet again and deleted the %USER%\AppData\Roaming|Local\Code directory. When I reinstalled, the extensions were still there.

How do I completely remove the installed extensions? I'd like to be sure I'm starting from scratch before opening a bug for the OmniSharp extension crash.

0

20 Answers 20

292

Turns out the extensions are stored under %USER%\.vscode\extensions. Deleting that gets rid of them.

For Windows: %USERPROFILE%\.vscode\extensions

Location of extensions for Linux/MAC: ~/.vscode/extensions

Sign up to request clarification or add additional context in comments.

7 Comments

Why are extensions themselves allowed to litter across the filesystem even after extension is uninstalled? for example, I downloaded a restclient and it writes to ~/.rest-client instead of keeping it to the ~/.vscode/extensions/* folder...
Deleting these and re-installing fixed all of my extension issues. So thankful for this post.
@Pacerier because VSCode extensions are arbitrary JavaScript code that runs in an unrestricted (non-sandboxed) Node.js environment by Electron, and there is no way to limit what a extension can do with this architecture.
Worked great, thanks. I've been trying to get rid of copilot but it kept reinstalling itself, now it's finally gone. Hopefully never to be seen again
It worked great, but beware it will remove all extensions and you might want to do it for only specific items which had issues in uninstalling or something. So better to keep a backup list of required extensions. so you can install it after removing all. hope it will some someone's time.
|
101

All the answers above are correct, but for a beginner, I wanted to add that all you have to do is, run this command in your terminal to remove ALL extensions/themes.

For Mac/Linux

rm -rf ~/.vscode/extensions 

For Windows

rmdir %USERPROFILE%\.vscode\extensions /s 

2 Comments

That's the questions being asked here.
This is incorrect, or only "partially correct". Please see @Pacerier comment further up saying extensions appear in other folders as well. These commands will clean up the extensions living in those places but not others. For me I had to manually eyeball hidden folders (shift + cmd + . to show hidden) in '~/` to find hidden folders matching extensions. I'm still looking for an easier way.
39

You can remove them at:

  • Windows: %USERPROFILE%\.vscode\extensions
  • Mac: ~/.vscode/extensions
  • Linux: ~/.vscode/extensions

Comments

33

If you are using Linux or macOS then try:

code --list-extensions | while read extension; do code --uninstall-extension $extension --force done 

On Windows you can do (not try 🤔😉):

for /f "usebackq tokens=*" %f in (`code --list-extensions`) do code --uninstall-extension %f --force 

Or this with Powershell:

code --list-extensions | % { code --uninstall-extension $_ --force } 

3 Comments

Perfect - Your top command works for Mac with code in PATH
In case of Linux, if you have gnu parallel installed, you can also try code --list-extensions | parallel -j 4 'code --uninstall-extension {} --force'
Excellent answer (+1). I needed to make a few passes to get rid of dependencies.
20

It worked for me, but the enviroment variable was %USERPROFILE%\.vscode\extensions

Comments

13

One line variant of Ahmad's answer:

code --list-extensions | xargs -L 1 code --uninstall-extension 

1 Comment

That's the best answer in the age of sync'ed settings.
11

If you want to remove a VSCode Extension in Windows 10 on WSL2 completely, then you need to look in a few additional directories:

~/.vscode-server/data/CachedExtensionVSIXs/
~/.vscode-server/data/User/globalStorage/
~/.vscode-server/extensions/

1 Comment

.vscode-server comes up in machines where you have sshed into using "Remote SSH" extension...
5

If you work with VS Code-Insiders extensions in folder: Windows

%USERPROFILE%.vscode-insiders\extension

MAC/Linux:

~/.vscode-insiders/extensions

Comments

5

use following command

code --list-extensions | foreach { code --uninstall-extension $_ } 

2 Comments

Awesome, some explication would be good, but this works perfectly in PowerShell for Visual Studio Code in Windows
Valid answer , Deleting the extension folder doesnot help because they reinstalled by sync from other device or my setting. THis uninstalled them all n all place
3

For Mac

Finder -> Go to Folder -> Go 

enter image description here enter image description here

Paste the directory ~/.vscode/extensions

Your are in your destination.

Comments

3

For Windows: Users\username\.vscode\extensions

You may delete any extensions you don't want.

To remove cached extension files:

  1. Click on "Show hidden items"
  2. Navigate to: C:\Users\username\AppData\Roaming\Code\CachedExtensionVSIXs
  3. Delete the files for any extensions you uninstalled

Comments

2

I found the following to be effective:

First, locate the extension ID:

code --list-extensions 

Then, uninstall it:

code --uninstall-extension ID 

Note: You must replace the ID with the ID you discovered in step one.

Comments

2

I had the problem after switching from 32-bit vscode to 64-bit versions of the vscode app, causing the C# extension uninstall-install flow to break in vscode.

I saw the folder ~\.vscode\extensions\ms-dotnettools.csharp-1.25.7-win32-ia32 (notice the -ia32 because 32-bit vscode had downloaded the x86 32-bit version.) After I deleted this folder then installed 64-bit vscode, trying to install the C# extension using the app's GUI or code CLI seemed to work, except after I opened vscode then it couldn't find the extension!

The fix was to open ~\.vscode\extensions\extensions.json and delete the JSON entry for ms-dotnettools.csharp which still pointed at the 32-bit extension. After deleting this part of the JSON file, installing C# extension from the GUI worked fine.

Comments

1

First, you have to find your resources of vscode.
The resources usually located in /usr/share (linux).
So you have to cd to /usr/share/code/resources/app to see extensions directory.
Now, you just use rm -rf extensions to remove extensions directory.

Comments

1

Once the extensions folder within .vscode-server directory is deleted, you might get the following error when trying to install extensions again.

Unable to read file '/home/user/.vscode-server/extensions/extensions.json' (Error: Unable to resolve nonexistent file '/home/user/.vscode-server/extensions/extensions.json')

To resolve this, you might as well as have to recreate some deleted files.

mkdir -p /home/user/.vscode-server/extensions touch /home/user/.vscode-server/extensions/extensions.json 

Try installing the extensions and everything should work.

Comments

0

All work for me, but there is an issue need to fix to get the directory on Windows use:

%USERPROFILE%\.vscode\extension,

That's it.

Comments

0

It may be because of some extension so uninstall it.

First go to extensions tab and then click the 3 dots in the top right corner then disable all extensions and check if the sound is gone or not . If yes then find the extension which was causing the problem and uninstall it.

Comments

0

I was having an issue on a laptop that I had migrated my settings from a previous one and maybe had some corrupted extension or something. I ended up uninstalling vscode and then manually deleting the roaming code folder completely.

  • C:\Users\%USERPROFILE%\AppData\Roaming\Code

Then after reinstalling and I was able to install the extension afterwards.

Comments

0

I also had a problem with cache, Only deleting the extension folder from %USERPROFILE%\.vscode\extensions didn't do the job,

I had also to delete the cache from %appdata%/Code/CachedExtensionVSIXs

Also pay attention that some Extensions store the data in the user folder with . prefix (%USERPROFILE%/.extName)

Comments

0

I solved this problem. Just delete extension in folder %USERPROFILE%\.vscode\extensions and delete extension's code in file %USERPROFILE%\.vscode\extensions\extension.json.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.