I wonder if anyone has a solution to this 2010 bug. I have a project that works fine in Visual Studio 2008, which will not be built in 2010, because Visual Studio keeps the DLL after starting the application ONLY if the designer window is open. I created a really easy project that shows this problem. If you are creating an application then create a dll lib. Put one form in the dll, open the form in the design view, and then run the application. It will work fine, then close the application, go to the form code view in the design view and change the code (I just renamed one variable), then try recompiling, you get the following:
Error 1 Failed to copy the file "obj \ Debug \ customlib.dll" to "build \ debug \ customlib.dll". The process cannot access the file 'build \ debug \ Customlib.dll' because it is being used by another process.
If you run Process Explorer and search for the DLL, the only process the DLL is in is the devenv.exe file.
I did a ton of searching on this issue and found similar problems with older versions of Dev Studio, where people could just add a preliminary version, a step to move the blocked DLL to another name (.locked) and build. Itβs good that it works the first time, but the next time you run, edit, you are blocked both from the current DLL and from the one you moved to .locked, so if I donβt want to add code to randomly create the name for a locked dll, this will not work for me (I don't want my debug directory to grow in size with files that are never deleted.)
I found only one workaround, and if you are in the same boat, this is what I have to do to edit and run. I am sure that EVERY design review window is closed. BEFORE I have ever run my project in the debugger. If you close all open design windows, the devenv.exe file will not contain dll.
Does anyone have a better solution to this problem?
source share