I wrote a custom class library for NUnit unit tests. It created a dll file containing my .NET IL code in the {project root}\bin\Debug\ folder. Running NUnit unit tests in this class library works fine, but if I try to compile my class library again, I get this error. NUnit isn't releasing the lock. What is causing this? How can I prevent this from occurring?
Visual Studio error when compiling after NUnit runs for first time:
Error {error #} {class library project name} Unable to copy file {class library project root folder} + "\bin\Debug\Tests.dll" to "bin\Debug\Tests.dll". The process cannot access the file 'bin\Debug\Tests.dll' because it is being used by another process.
So the only way I can change the code is to close NUnit and re-open NUnit. I'm using NUnit 2.6. It's very annoying.