tags:

views:

1042

answers:

3

I'm using Hudson as a continuous integration server. The jobs ultimately kick off MSBuild. Everyone once in a while, my build fails with a non-code-compilation error out of MSBuild:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2703,9): error MSB3021: Unable to copy file "..\Lib\Microsoft\Microsoft.Practices.Unity.Configuration.dll" to "bin\Debug\Microsoft.Practices.Unity.Configuration.dll". Access to the path 'bin\Debug\Microsoft.Practices.Unity.Configuration.dll' is denied.

When I examine 'bin\Debug\Microsoft.Practices.Unity.Configuration.dll', I find it to be a 0-byte file.

I'm at a loss for why this file is being problematic. Any ideas?

A: 

Sounds like a process is holding bin\Debug\Microsoft.Practices.Unity.Configuration.dll open. You can check that earlier by renaming 'bin' to something else, like 'bin-old' and then removing 'bin-old' If any process is holding the files in 'bin' open, the rename will fail.

Michael Donohue
A: 

Use Handle.exe from SysInternals (Microsoft) to see which files are being held open by which processes.

Run this at a cmd prompt when you get the error; Handle.exe > OpenFile.txt Notepad.exe OpenFile.txt

Then search OpenFile.txt for the file that is locked and you'll see the process.

Ryan

Ryan ONeill
Using ProcessExplorer from SysInternals would be a more direct way of doing this. Select "Find" .. "Find Handle or DLL.." and then paste the file name into the search box.
Michael Donohue