Unable to copy file reference.dll to bin/reference.dll. The process cannot access the file reference.dll because it is being used by another process

后端 未结 30 2118
深忆病人
深忆病人 2021-01-31 03:34

For one of my ASP.NET 3.5 applications, every single time I try to build the web app, it throws the following build errors in Visual Studio 2008:

Error 16

30条回答
  •  梦如初夏
    2021-01-31 04:01

    I just wanted to say that this problem started with me today. (VS 2010, C#) I have been working on this program for a month without this problem, now today it started. I start VS, change code, compile and test and quit program. Make another change, compile and BOOM Unable to copy file "obj\x86\Debug\progname.exe" to "bin\Debug\progname.exe" because if is being used by another process.

    ProcExp shows only Visual Studio (actually devenv.exe) using this file. There is only one instance of VS running. There are two listing on my debug\progname.exe, one is a Type DLL, the other is a Type handle.

    Using devenv /ResetSettings did not resolve anything, but wasted 10 minutes putting everything back to my desired view.

    Using the PREBUILD events rename trick mentioned above solves the problem for a couple of changes, but on the next change the "exe.locked" file is locked and cannot be deleted. Then the rename fails.

    The debug\progname.exe file name remains locked even after closing the project.

    Closing VS, manually delete the files in the debug folder, opening VS and my solution, then Build->Clean Solution seems to work for me, at least its working now after I did all of that stuff.

    Hope this helps -rwg

提交回复
热议问题