Why doesn't Visual Studio release files?
I have had a long running issue where Visual Studio won't release files and so I can't delete them or move them.
This happended to me a couple of weeks ago:
1. I copied a DLL to my computer.
2. I set a reference to that DLL in a project.
3. I decided I want a different DLL.
4. I removed the reference to that DLL from my project.
5. I tried to delete the DLL from my computer.
What happened? Visual Studio was still using the file, so Windows wouldn’t let me release it. This happened with VS 2008 and Vista. It also happened with VS 2010 and Windows 7.
Related to this is renaming a folder. I create a project. I rename it. I decide I want to rename the folder it is in. I close the solution. Windows won’t let me rename the folder. I close Visual Studio. Windows still won’t let me rename the folder. I have to reboot the computer. This has happened numerous times with VS 2008 and Vista. I have not tried it with VS 2010 and Win 7 yet.
I asked a contact on the VB team if this is a known issue and would they fix it. My contact forwarded my mail to someone on the VS Platform team. The response I got was that these types of issues are very hard to nail down. Any component interacting with the DLL could be holding a reference to it. This includes the project system, MSBuild, IntelliSense, the VS designers. He wanted to know if this was happening on a particular project or DLL. Unfortunately, the answer to that is no. I have seen this on numerous projects, more often than not C# rather than VB.
Have you seen this? Have you seen it in specific scenarios? If you have, let me know and I will forward your experinece on to the VS Platform team. The more info we can give them, the more chance we have of them fixing this most annoying behavior.