title: Fluent NNhibernate Exception when running MSTest from commandline
body: <p>I'm writing some unit tests for Fluent NHibernate mappings (for the first time). When run in visual studio they run perfectly fine. </p>
  
  <p>This is using Resharpers Unit Test window or the built in Visual Studio one. </p>
  
  <p>The problem is when the unit tests are run from MSTest:</p>
  
  <pre><code>mstest /testcontainer:Tests.MyProject.dll</code></pre>
  
  <p>The unit tests fail...</p>
  
  <p>The only error I get from the trx file thats generated is:</p>
  
  <blockquote>
    <p>BlockquoteUnit Test Adapter threw exception: Type is not resolved for member 'FluentNHibernate.Cfg.FluentConfigurationException,FluentNHibernate, Version=1.2.0.694, Culture=neutral, PublicKeyToken=8aa435e3cb308880'..</p>
  </blockquote>
  
  <p>Which doesn't help... I can't debug the code because it works perfectly fine in visual studio, and the error message in the test file doesn't give me any information...</p>
  
  <p>The code around creating the session is:</p>
  
  <pre><code>    public class InMemoryDatabaseTest : IDisposable
      {
          private Configuration _configuration;
          private ISessionFactory _sessionFactory;
          protected ISession _session;
  
          public InMemoryDatabaseTest(Assembly assemblyContainingMappedType)
          {
              if (_configuration == null)
                  _sessionFactory = CreateSessionFactory(assemblyContainingMappedType);
  
              _session = _sessionFactory.OpenSession();
  
              new SchemaExport(_configuration).Execute(false, true, false, _session.Connection, Console.Out);
          }
  
          private ISessionFactory CreateSessionFactory(Assembly assemblyContainingMappedType)
          {
              return Fluently.Configure()
                  .Database(SQLiteConfiguration.Standard.InMemory)
                  .Mappings(m => m.FluentMappings.AddFromAssembly(assemblyContainingMappedType))
                  .ExposeConfiguration(cfg => _configuration = cfg)
                  .BuildSessionFactory();
          }
  
          public void Dispose()
          {
              _session.Dispose();
          }
      }</code></pre>
  
  <p>I'm not sure if this is the correct way of creating the session for unit testing tho.</p>
  
  <p>Anyone got any idea what's wrong :(</p>