views:

146

answers:

2

I'm getting two of these errors when trying to build the full solution for our website. Here's the full text of the errors:

Error 91 Cannot copy assembly 'Emcom.DataAccess.dll' to file 'C:\work\evan-moor.com-trunk\2007.evan-moor.com\Bin\Emcom.DataAccess.dll'. Unable to add 'C:\work\evan-moor.com-development\Emcom.DataAccess\bin\Debug\Emcom.DataAccess.dll' to the Web site. Unable to add file 'Bin\Emcom.DataAccess.dll'. The process cannot access the file because it is being used by another process.
C:...\2007.evan-moor.com\

Error 92 Cannot copy assembly 'Emcom.DataAccess.Generated.dll' to file 'C:\work\evan-moor.com-trunk\2007.evan-moor.com\Bin\Emcom.DataAccess.Generated.dll'. Unable to add 'C:\work\evan-moor.com-development\Emcom.DataAccess\bin\Debug\Emcom.DataAccess.Generated.dll' to the Web site. Unable to add file 'Bin\Emcom.DataAccess.Generated.dll'. The process cannot access the file because it is being used by another process.
C:...\2007.evan-moor.com\

I've done everything I can think of short of reinstalling Visual Studio to try and fix this and nothing works. One of my co-workers also gets these errors, but another one does not. I suspect one of us might have done a merge incorrectly to cause this given that it's referring to the development folder in here while I'm trying to build the solution of the trunk.

I've checked and double checked all the dlls, and the two projects referenced here and neither of them are using the development folder, which I suspected might have caused this. I also did a clean brand new checkout of our trunk, and still got these errors. Then I tried deleting all the .NET temporary files to solve it, and still no luck. I did a google search for this issue and found a Microsoft hotfix for the problem which involved replacing a dll - but that was for Visual Studio 2003, and I'm using 2008. The dll in question on my computer is two full versions newer than the replacement version they list in the hotfix, so I'm not sure it'd be a good idea to replace what I've got with what's mentioned there.

Any ideas? Short of reinstalling Visual Studio and reformatting my computer, I'm out of ideas. Reinstalling might do it, but reformatting would be too much work just to fix this bug.

A: 

You could give "WhoLockMe" a try. It is an addin for windows explorer and is available from teh context menu. Navigate to the dll, use the utility and if it reports an locks there is a kill process function available.

Download from http://www.dr-hoiby.com/WhoLockMe/

Instructions for use are available on the same web site.

simon_bellis
Good suggestion. I tried that during a build when the problem happens and WhoLockMe threw an error though. So unfortunately it doesn't look like that's going to help.
Evan
A: 

I thought I'd answer this in case anyone else is having this problem as well. One of my coworkers ended up solving this problem for me. It ended up being an issue of an incorrect build order, which he fixed by moving project references around to correct the build order. One project was dependent on another project, and was being built before the project it was dependent upon. Once he fixed this, the problem went away.

Evan