I am using Visual Studio 2005 to develop a Desktop application with C#. I have a solution with 10-15 proyects, and sometimes, when I try to run the application I get this error:
"Unable to copy file "C:\DataSet\bin\Debug\DataSets.dll" to "bin\Debug\DataSets.dll". The process cannot access the file 'bin\Debug\DataSets.dll' because it is being used by another process.
The only way I found to solve this problem is by restarting Visual Studio. The dll is not always the same (the project generating the problem usually changes)
I am working in a group of 20 developers, and we *randomically* get the error.
Does anyone know how to solve this?
I'm trying to solve the same problem right now. All i can tell you is that i have
<hostingEnvironment shadowCopyBinAssemblies="false" />
in my webcofig, and that i rebuild the project that refers to the 'problem dll' when i get this error. It is beter than restarting VS but still no solution.
(Rebuilding is only available via rightclicking on project)
We've had this problem with Studio 2005 from the outset.
error MSB3021: Unable to copy file "obj\Debug\XXX.dll" to "bin\Debug\XXX.dll". The process cannot access the file 'bin\Debug\XXX.dll' because it is being used by another process.
Disabling Visual Studio hosting doesn't fix it, neither does setting the <GenerateResourceNeverLockTypeAssemblies> project property.
At least for me, it appears to be related to particular solutions when they are set as the Startup Project. I can work around the problem by setting another project as the Startup, then building and launching the debugger from the context menu for the project I'm building/debugging.