I have an integration test for a method in assembly A
. Assembly A
references assembly B
via project reference. I run them under the Visual Studio 2010 debugger in a Resharper 6.1 unit testing scenario. The testing engine is Microsoft's native MSTest.
I get the infamous
The process cannot access the file
...\B.dll
because it is being used by another process.
message. I have verified that no other process has a handle on that file (e.g. via Sysinternal's Process Explorer).
Running the test out of the debugger works fine. Any ideas why it happens under the debugger and what I can do to fix it?
Building upon Sébastien's answer, I added a pre-build step to my test project to automatically kill any vstest.*
executables still running. The following pre-build command worked for me:
taskkill /f /im vstest.*
exit 0
The exit 0
command is at the end to prevent build failure when there are no vstest.*
executables running.
I have seen a similar situation, and found in the task manager that vtest.discoveryengine.exe and vtest.executionengine.exe were still alive. I killed both, which solved the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With