I have this .dll file I just can't delete:
C:\Users\Alisson\Source\Repos\portal-do-guitar-flash\PortalGuitarFlash.Web\obj\Debug\PortalGuitarFlash.Web.dll
I have admin rights and the only way of deleting it, is restarting the computer (it doesn't need to be safe mode). This file is generated by Visual Studio and this .dll is the result of a Project (website) build. Every build, Visual Studio overwrites this file. I make a lot of builds every day, but suddenly VS just can't build, because it can't overwrite the file.
If I just open the file's folder, and click on the file, Windows Explorer crashes (by only selecting it). The problem persists even after killing Visual Studio processes (desenv.exe, MSBuild.exe) and IIS Processes.
The Windows Explorer doesn't show any window/popup telling me the file is in use by another process. Actually the window just freezes, and I have to kill the Explorer process.
In the same folder of this .dll, there are some other files I can delete, this PortalGuitarFlash.Web.dll is the only one I cannot.
If I even "click" on it, Explorer instantly freezes:
- I tried using cmd to force delete (
del /l PortalGuitarFlash.Web.dll
), but cmd freezes - I tried renaming obj and Debug folders, explorer freezes
- I also followed this Super User Question's answer, downloaded "Process Explorer" software to find out if there were any processes locking this file, but they didn't find anything.
I did some additional testing.
I opened CMD again, and tried to delete the file. cmd freezes. If then I try to rename Debug Folder, it shows I can't do it because it's being used by something. Process Explorer software showed me that it was being used by cmd.exe. After killing cmd.exe process and trying to rename again, Explorer FREEZES.
Even if I logoff Windows and log in again, it doesn't work. I have also ran antivirus, disk cleanup and defrag, just as a precaution.
The only way of removing this file is restarting the computer. This happened once yesterday, and once today.
Deleting the file itself is not the problem, but why it's locked is.
Has anyone passed through this problem? Any ideas of what should I do?