title: Fluent NHibernate failing to create session factory with SQLCE
body: <p>I'm trying out my very first project with Fluent NHibernate (any NHibernate flavor for that matter). I've been unable to get past the point of creating a Session Factory object as I'm running in to the following exception:</p>
  
  <pre><code>InnerException: NHibernate.HibernateException
                        Message=The IDbCommand and IDbConnection implementation in the assembly System.Data.SqlServerCe could not be found. Ensure that the assembly System.Data.SqlServerCe is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use &lt;qualifyAssembly/&gt; element in the application configuration file to specify the full name of the assembly.
                        Source=NHibernate
                        StackTrace:
                             at NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName)
                             at NHibernate.Driver.SqlServerCeDriver..ctor()
                        InnerException: 
  </code></pre>
  
  <p>I'm using the latest FluentNHibernate binaries. VS 2010, on Window 7 x64. I've set the System.Data.SqlServerCe assembly to "Copy Local" changed the project's target platform to x86.</p>
  
  <p>The fluent config is:</p>
  
  <pre><code>var config  = Fluently.Configure()
                          .Database(MsSqlCeConfiguration.Standard.ShowSql().ConnectionString(cnxString))
                          .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;SyncContract&gt;());
  
  if (!File.Exists(dbPath))
  {
       var engine = new System.Data.SqlServerCe.SqlCeEngine(cnxString);
       engine.CreateDatabase();
  
       config.ExposeConfiguration(c =&gt; new SchemaExport(c).Create(false, true));
  }
  return config;
  </code></pre>
  
  <p>Note: engine.CreateDatabase() works fine.</p>
  
  <p>Any help/ideas please?</p>