0

I have a project, which contains various classes and user controls. Every once in a while, often on the second build attempt, Visual studio locks the project's target assembly and the build fails with the following error:

Unable to copy file "obj\x86\Debug\MyProject.dll" to "bin\x86\Debug\MyProject.dll". The process cannot access the file 'bin\x86\Debug\MyProject.dll' because it is being used by another process.

This same issue was reported here: VisualStudio2010 Debugging - The process cannot access the file ... because it is being used by another process. I tried a few of the presented answers, but none of them resolved the matter for me.

Any suggestions?

Community
  • 1
  • 1
Elan
  • 6,084
  • 12
  • 64
  • 84
  • sometimes it helps to change from Debug to Release; build it and then change back – ralf.w. Dec 05 '11 at 19:03
  • Changing to Release, does let me do a Release build, but unfortunately changing it back to Debug was still locked up. – Elan Dec 08 '11 at 06:48

1 Answers1

-1

I read somewhere it's a known issue and they're working on a hotfix - knowing Microsoft it should come out about the time Windows 9 does.

The current only real fix is to uninstall SP1, but since I can't be bothered doing that I just delete all the project files in the Debug folder, but you have to do this every time it throws the error. You can't use a program or batch file to do this since for some reason it completely locks the file and you have to wait ~5mins for the system to unlock and delete it.

TheCodeArtist
  • 21,479
  • 4
  • 69
  • 130
Deadly-Bagel
  • 1,612
  • 1
  • 9
  • 21