'Cannot delete folder in Visual Studio Code definitely

I deleted a folder in Visual Studio Code to recreate it. But each time it recovers all files whereas I just want to create a new empty folder with same name.



Solution 1:[1]

This is a common issue that I am also facing for more then a year now and I am unable to find an open issue about this on Github. Every issue related to this that is opened gets closed because the developers are unable to find the source of the problem.

One way I could sometimes replicate the issue is to:

  1. Open the project folder in Windows Explorer
  2. Search for something inside VSCode that is contained in the folder you are going to delete.
  3. Try to delete the folder in VSCode.
  4. Folder is not deleted.

Clearing the search after does not solve the issue. Most of the times I have to close and reopen VSCode.

Another ridiculous part is that the VSCode sends the file to the OS Trash and you are unable to undo the deletion when it works (CRTL + Z). VSCode is being pushed to the community by many developers but is really an infant editing tool that is terrible, the only amazing part of it is the huge ammount of plugins.

This is a long lasting bug that occurs ALL THE TIME with me. I know this is not a valid answer, but it's what I know about this problem this far.

Solution 2:[2]

i had the same problem. But works turn off malwarebytes. Maybe another antivirus is blocking to delete folders to, try this.

Solution 3:[3]

Try running Visual Studio in Administrator mode. It worked for me.

Solution 4:[4]

It took 6 hours to find out that.... it can be deleted by VsCode file explorer, if i try to delete it manually it juggles with admin permission and user permission back and fourth.

Just delete the folder from VSCODE file explorer from the left menu.

Solution 5:[5]

I just restart my mac and everything went well after that ?

Solution 6:[6]

i had the same problem. I go to Terminal and turn off all powershell,a voala I finally can delete folder from VS explorer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Gustavo Garcia
Solution 3 mrmowji
Solution 4 EngineSense
Solution 5 JulienRioux
Solution 6 Jelena