I was getting errors that assemblies where being locked and when trying to delete them it indicated that vstest.executionengine.x86.exe had the assemblies open, for a while I was just killing the process and then running the next test run but today the TFS Build server starting giving the same issues. After some digging I found the that this had been brought to Microsoft’s attention and they say it’s by design, Response below.
The workaround/fix for this is to create a .runsettings xml file that has the following structure
Then go to [MENU]> Test > Test Settings > Select Test Settings File
Browse to the settings file (I advise keeping this file either in the root of the solution or in the unit test project.
Lastly make sure you have killed the vstest.executionengine.x86.exe from any previous runs and from now you won’t have any locking issues.
Hope this helps =D