Friday, October 10, 2008

Test run pending trouble

Sometimes when I start unit test from visual studio all test are in pending phase and no test will run.
Open task manager find proses named as VSTestHost.exe and kill it. After that try to start tests again.
It works for me.

And here is macro to do that for you



Sub KillDeadTestProcess()
Dim objProcess As System.Diagnostics.Process
For Each objProcess In System.Diagnostics.Process.GetProcesses()
Debug.Print(objProcess.ProcessName)
If (objProcess.ProcessName = "VSTestHost") Then
objProcess.Kill()
End If
Next
End Sub

1 comment:

Anonymous said...

Thanks, this is really handy. I wish I could work out why it hangs though, every other test run in debug hangs like this for me.