Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Visual Studio take so long to delete a file

Why does Visual studio take so long to delete a file from the solution tree? The app freezes and sits there for what feels like an eternity.

If I delete the file from the file system first, then delete it in the solution it happens instantly.

Is there an option I can set somewhere to avoid this?

like image 301
mattcole Avatar asked Oct 08 '08 16:10

mattcole


People also ask

Why is deleting files taking so long?

The reason is that during the delete process, Windows 10 runs calculations, analyzes, and shows updates as files and folders get deleted on the screen, something that usually takes time when deleting a large folder with thousands of files and subfolders.

Why does VSCode take so long to delete files?

it could be rebuilding/removing from the intellisense database or checking the rest of the project for validity once the file is deleted. Or it could just be that the new VSs are buggy. The thing is though, if I've already deleted it on disk, it happens instantly, so it must have some links to the file system.

Is it safe to delete .VS folder?

Yes, you can delete it. visual studio will simply recreate that folder for you. Save this answer. Show activity on this post.

How do you force delete a file in C#?

To delete a file in C#, you can use System. IO. File. Delete(path) function.


2 Answers

I've found that when there is a lot in my Recycle Bin (1000s of files), it takes longer to delete a file in Windows Explorer as well as Visual Studio.

like image 124
jrummell Avatar answered Oct 19 '22 13:10

jrummell


I've found that this is sometimes a symptom of project size. Deleting a file from a project with hundreds of files can take 30 seconds on my (admittedly slow) work computer. But deleting one of two files in a project is usually instant.

like image 32
TheSmurf Avatar answered Oct 19 '22 12:10

TheSmurf