Alex Rivera | Logout

NUnit: "The process cannot access the file ... because it is being used by another process."

Asked 2009-06-01T15:10:26.893
27

I'm using the NUnit GUI version, and it started to get upset at me when I have a test project loaded in there trying to test things. If I make a change in Visual Studio, and then try to rebuild the solution, it throws the error "Unable to copy file obj\Debug\foo.dll to bin\Debug\foo.dll. The process cannot access the file bin\Debug\foo.dll because it is being used by another process."

This is the DLL I have loaded into the GUI, of course. It used to be OK, and just refresh the project reference after a build, but now it seems to be blocking it. How can I get back to that behavior?

I've tried enabling/disabling the shadow copy setting by the way, with the same results either way.

VS2008 SP1 and NUnit 2.4.8, if that matters.

Edit
Report

1 Answer

1

I had this problem too, but I'm strugling to reproduce it today. The forums seem to suggest that it is due to your code not giving back resources that it was using. This rings a bell as I would have been testing an Xml reader when I had this issue.

Here's a link I found on asp.net

answered 2009-06-01T15:34:35.050

Your Answer