How can I stop the Visual Studio Test Runner when a test hangs

You can click "Cancel" in Test Explorer:

enter image description here

Show Test Explorer by going to TEST > Windows > Test Explorer.

This is in Visual Studio 2013.

Instructions for other versions of VS can be found here


Sorry for waking up an old thread:) just wanted to share my solution here, I had the same issue on VS 2015. There is some text below the search input just where the cancel should appear (take a look at @Codeman print screen), the text is actually some description on how you can setup a build for your tests, the text is several lines and at the end you have "do not show this any more" just press it and then the cancel button appears:) Very strange bug, sorry I do not have some print screens of this hope it helps someone


VS2015. If the hanging tests are executables instead of DLLs you need to kill those tests in the task manager. You need to close the Test Explorer Window to prevent automatic running. While the tests are running/hanging you will not be able to compile the according project.