title: System.AppDomainUnloadedException in TFS build and delays the whole test run
body: <p>We are seeing our builds on TFS taking too long and investigating the reason. Then I found that in each build during test run, some tests started over 30 seconds after the last test ended. So it is wasting lots of time for each build! The pattern when the pauses occurred was very random. When I dig into the activity log in the build, I noticed this message around those breaks:</p>
  
  <pre><code>System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. This can happen if the test(s) started a thread but did not stop it. Make sure that all the threads started by the test(s) are stopped before completion.
  </code></pre>
  
  <p>What does this mean? Is there a way to check which test is having this issue and how to avoid it? Thanks.</p>