title: How to programmatically run unit tests with Gallio and MBUnit?
body: <p>I'm trying to programmatically check my unit tests are passing as part of my deployment process. The application uses MBunit and Gallio for it's unit testing framework.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>var setup = new Gallio.Runtime.RuntimeSetup();
  setup.AddPluginDirectory(@"C:\Program Files\Gallio\bin");
  
  using (TextWriter tw = new StreamWriter(logFilename))
  {
      var logger = new Gallio.Runtime.Logging.TextLogger(tw);
      RuntimeBootstrap.Initialize(setup, logger);
  
      TestLauncher launcher = new TestLauncher();                
      launcher.AddFilePattern(dllToRunFilename);
      TestLauncherResult result = launcher.Run();
  }
  </code></pre>
  
  <p>Here's the test which is contained in the DLL I'm loading (I've validated this works with the Icarus test runner):</p>
  
  <pre><code>public class Tests
      {
          [Test]
          public void Pass()
          {            
              Assert.IsTrue(true);
          }
  
          [Test]
          public void Fail()
          {
              Assert.Fail();
          }
      }
  </code></pre>
  
  <p>When I run the application I get the following values in <code>results</code></p>
  
  <p><img src="https://i.stack.imgur.com/C1n70.png" alt="enter image description here"></p>
  
  <p>Which is incorrect as there are indeed tests to run! The log file has the following in it</p>
  
  <blockquote>
    <p>Disabled plugin 'Gallio.VisualStudio.Shell90': The plugin enable
    condition was not satisfied.  Please note that this is the intended
    behavior for plugins that must be hosted inside third party
    applications in order to work.  Enable condition:
    '${process:DEVENV.EXE_V9.0} or ${process:VSTESTHOST.EXE_V9.0} or
    ${process:MSTEST.EXE_V9.0} or ${framework:NET35}'. Disabled plugin
    'Gallio.VisualStudio.Tip90': The plugin depends on another disabled
    plugin: 'Gallio.VisualStudio.Shell90'.</p>
  </blockquote>
  
  <p>How do I resolve this issue and find the results to the tests?</p>