我对NHibernate非常陌生,所以如果我在这里遗漏了一些微不足道的话我会道歉.我目前正在编写一本名为"NHibernate 3初学者指南"的书,来自packtpub.我大多数都遵循书中的指示.当我说大多数情况下我使用MySQL而不是MSSQL而已经分歧并且一直在使用NuGet而不是手动下载二进制文件.
我现在在第2章,这是第一个真正的编码章节.在本章中,我将构建一个简单的WPF应用程序,通过单击按钮来构建我的数据库模式.我已经为本章中指定的类Product和Category类构建了一些POCO .通过NuGet,我添加了以下参考:
当我单击按钮来构建我的数据库时,执行以下代码块:
private const string connString = "string omitted for brevity";
private void btnCreateDatabase_Click(object sender, RoutedEventArgs e)
{
Fluently.Configure().Database(MySQLConfiguration.Standard.ConnectionString(connString))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<ProductMap>())
.ExposeConfiguration(CreateSchema)
.BuildConfiguration();
}
Run Code Online (Sandbox Code Playgroud)
单击按钮后,我收到以下异常(FileLoadException):
外部异常消息: Could not load file or assembly 'Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
内部例外消息: Could not load file or assembly 'Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' …
最近我用最新版本4.0.3.4000升级了我的NHibernate库.之后 - 在编译期间,我遇到了与"Iesi.Collections.Generic.ISet"相关的问题.从细节我明白 - 这个界面被删除,备用选项可用 - 其中一个是LinkedHashSet.
我想知道 - 这是取代ISet的最佳替代方案吗?