After removing a Visual Studio Project from a Solution cannot delete the folder in windows

When I 'Remove' a project from a Visual Studio solution I often want to delete it. As some other posts on SO have mentioned this does not delete the physical project from the file system. The larger problem here is that after removing the project form the solution when I attempt to delete the directory from windows Explorer or the command line it will not delete because Visual Studio still has it locked. Usually, I am able to resolve this by exiting Visual Studio then doing the delete. But, occasionally I have had to log off and back on before being able to delete the directory. I have had this problem in VS2008, VS2010 and probably the earlier versions as well. My question is, if there is no way to do this delete from inside Visual Studio, is there at least a way to get it to let go of the file(s) that it has locked?


You could use Process Explorer, which allows you to close specific handles a program is holding onto. Just open it up, find the Visual Studio process (devenv.exe), use View/Lower Pane View/Handles, locate the proper handle in the lower pane, right-click it and choose "Close Handle". May not be ideal, but sometimes this is better than closing your app or killing the process.

Besides devenv.exe which goes away when you close Visual Studio, you might try killing mspdbsrv.exe. It will restart as soon as an instance of Visual Studio needs it.

You could use a tool like Unlocker to unlock the files.

Need Your Help

Is there a difference between Service context and Application context in Android?

android android-activity service android-context difference

As title says, what is the difference (if any)? I was able to find only difference between Activity X Application contexts, but not Service X Application ones.

Pivoted pandas dataframe to dictionary conversion

python pandas dataframe pivot-table

I have a pivoted pandas dataframe as shown in attachment.