Я пробую свой самый первый проект с Fluent NHibernate (любой вкус NHibernate в этом отношении). Мне не удалось пройти через точку создания объекта Session Factory, так как я работаю со следующим исключением:
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 <qualifyAssembly/> 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:
Я использую последние двоичные файлы FluentNHibernate. VS 2010, на Windows 7 x64. Я установил сборку System.Data.SqlServerCe на «Копировать локально», изменил целевую платформу проекта на x86.
Свободный конфиг:
var config = Fluently.Configure()
.Database(MsSqlCeConfiguration.Standard.ShowSql().ConnectionString(cnxString))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<SyncContract>());
if (!File.Exists(dbPath))
{
var engine = new System.Data.SqlServerCe.SqlCeEngine(cnxString);
engine.CreateDatabase();
config.ExposeConfiguration(c => new SchemaExport(c).Create(false, true));
}
return config;
Примечание: engine.CreateDatabase () работает нормально.
Любая помощь / идеи, пожалуйста?