title: Debugging assembly load issue
body: <p>I have a very wierd problem happening to me during unit testing (MSTest in Visual Studio - .NET 3.5 SP1):</p>
  
  <ol>
  <li>I click "Run All Tests in solution"</li>
  <li>All tests passes, <em>except</em> for one particular class, where every tests throws the following exception: "System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)."</li>
  <li>I then go and set a breakpoint in the class. Result: all tests in the class passes (the same tests that failed before).</li>
  <li>I click "Run All Tests in solution". All tests passes, except for <em>another</em> class.</li>
  <li>I go set a breakpoint in the class. Result: All tests in the class passes</li>
  <li>I click "Run All Tests in solution". All tests passes, except for the first testclass again.</li>
  <li>etc.</li>
  </ol>
  
  <p>As you can see the problem is very inconsistent, making it hard to debug.</p>
  
  <p>I've tried using Fusion Log Viewer, but that gave me confusing results I didn't quite understand.</p>
  
  <p>What should I be looking for? Has anyone else experienced this problem?</p>
  
  <p><strong>Update:</strong>
  Some additional info was requested.</p>
  
  <p>The tests has run fine for months - I think last time I ran them was thursday, and then they ran fine. I've been trying to examine the source control history, to see if something has changed, but nothing out of the ordinary. </p>
  
  <p>I could track back and check out the project at different days back in time, but we're using Visual Source Safe (I know - not my descission :-( ) so I'm hesitating to do that.</p>
  
  <p>The tests are regular unit tests, and I'm using Moq for mock-objects... But as I said - it has worked fine until recently.</p>
  
  <p>I was just hoping for some advice on how to debug this issue.</p>