VS2015 – Files locked after unit tests

I haven’t figured out yet why it is happening, but after a recent update I suddenly ran into an issue where when I ‘Run All Unit Tests’ in Visual Studio 2015 (Update 3) I end up with locked assemblies. This in turn does not allow me to run any subsequent tests.

Workaround is to kill the unit test processes that are locking the files using a command line (run as administrator account):

taskkill /F /IM vstest* /T

2016-07-26

Not the most elegant solution, but it will work for now.