138

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.

Gama11
  • 31,714
  • 9
  • 78
  • 100
Astaar
  • 5,858
  • 8
  • 40
  • 57

16 Answers16

236

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

For Windows : %USER%\\.vscode\extensions (or) %USERPROFILE%\.vscode\extensions

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

kn_pavan
  • 1,510
  • 3
  • 21
  • 42
Astaar
  • 5,858
  • 8
  • 40
  • 57
  • 31
    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... – Pacerier Feb 16 '18 at 15:27
  • 1
    Deleting these and re-installing fixed all of my extension issues. So thankful for this post. – John Edwards Jul 30 '18 at 01:29
  • @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. – Zhe Jan 19 '23 at 02:26
  • 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 – Daniel W Jun 27 '23 at 11:38
  • 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. – Shamsul Haque Aug 10 '23 at 10:04
88

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
Aryan Beezadhur
  • 4,503
  • 4
  • 21
  • 42
Ahmad Awais
  • 33,440
  • 5
  • 74
  • 56
  • 6
    That's the questions being asked here. – Ahmad Awais Jun 12 '18 at 01:35
  • 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. – snowcode Oct 26 '19 at 12:42
34

You can remove them at:

  • Windows: %USERPROFILE%\.vscode\extensions
  • Mac: ~/.vscode/extensions
  • Linux: ~/.vscode/extensions
informatik01
  • 16,038
  • 10
  • 74
  • 104
Dzung
  • 469
  • 4
  • 5
19

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

arendon
  • 191
  • 1
  • 3
11

If you are using Linux 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
Luuk
  • 12,245
  • 5
  • 22
  • 33
Ahmad Ismail
  • 11,636
  • 6
  • 52
  • 87
8

One line variant of Ahmad's answer:

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

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/

ioCron
  • 873
  • 8
  • 9
5

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

%USERPROFILE%.vscode-insiders\extension

MAC/Linux:

~/.vscode-insiders/extensions

Timbioz
  • 175
  • 3
  • 8
1

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.

Tunvir Rahman Tusher
  • 6,421
  • 2
  • 37
  • 32
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.

Hieu Doan
  • 115
  • 1
  • 7
1

For Windows - Users\username.vscode\extensions You may delete what extensions you don't want. And Click on hidden items then follow the below instructions - This PC -> C:\Users\username\AppData\Roaming\Code\CachedExtensionVSIXs and delete file which you uninstalled.

Sudharshan S
  • 89
  • 1
  • 8
1

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.

1

use following command

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

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 sawthe folder %USER%\\.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.

Carl Walsh
  • 6,100
  • 2
  • 46
  • 50
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.

Whizkevina
  • 11
  • 2
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.