See my answer here if you're having this problem while running unit tests. Answer copied below:
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 novstest.*
executables running.