I’ve had several situation with large solutions in VS2010 where assemblies get locked and references need to be constantly fixed, failing compilations. I would get errors when copying the DLL’s from the OBJ into the BIN folders, or even copying a schema assembly into the bin folder of the maps project which uses it. One “detail” (or not) was that the BizTalk and C# projects in the solution where upgraded from previous versions (BTS2004).
Using SysInternal’s Handle.exe tool, I found it was Devenv itself locking the assemblies.
I’ve tried several solutions that didn’t work, including:
What eventually solved the issue was a variation of the first solution Benson gave in the previous link, and which is documented here in a StackOverflow response by Godeke: code a small command line tool (VisualStudioLockWorkaround) that removes locks and which you add as a pre-build script to the troublesome VS projects. It’s ugly, but it solved my problem, after some hours of trying to figure out what was happening.