gpt4 book ai didi

nhibernate - 模糊的 NHibernate/Fluent NHibernate 错误

转载 作者:行者123 更新时间:2023-12-03 06:53:33 25 4
gpt4 key购买 nike

我在尝试构建一个时遇到以下错误 session 工厂:

PersistenceTests.Can_Map_Orders_To_Database : Failed 
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at NHibernate.Mapping.Column.set_Name(String value)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumns(XmlNode node,
SimpleValue model, Boolean isNullable, Boolean autoColumn, String
propertyPath)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumnsOrFormula
(XmlNode node, SimpleValue simpleValue, String path, Boolean
isNullable)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindSimpleValue(XmlNode
node, SimpleValue model, Boolean isNullable, String path)
at
NHibernate.Cfg.XmlHbmBinding.CollectionBinder.BindCollectionSecondPass
(XmlNode node, Collection model, IDictionary`2 persistentClasses)
at
NHibernate.Cfg.XmlHbmBinding.CollectionBinder.<>c__DisplayClassd.<AddCollec tionSecondPass>b__c
(IDictionary`2 persistentClasses)
at NHibernate.Cfg.Configuration.SecondPassCompile()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 94
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
incomplete configuration was used while creating a SessionFactory.
Check PotentialReasons collection, and InnerException for more detail.
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 99
at FluentNHibernate.SessionSource..ctor(FluentConfiguration config) in
c:\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src
\FluentNHibernate\SessionSource.cs: line 38
at
FluentNHibernate.Testing.SingleConnectionSessionSourceForSQLiteInMemoryTest ing..ctor
(FluentConfiguration config) in c:\Code Samples\NHibernate\Fluent
Nhibernate - Trunk\src\FluentNHibernate\Testing
\SingleConnectionSessionSourceForSQLiteInMemoryTesting.cs: line 15
at Core.Infrastructure.Data.NHibernate.Tests.PersistenceTests.SetUp()
in PersistenceTests.cs: line 26

我正在针对 FNH 主干和 NH 2.0.1 进行工作。有趣的是我是能够编译我的映射(通过 AutoPersistenceModel.CompileMappings)并成功将它们写入文件系统 - FNH 不会提示。仅当尝试构建 session 工厂时一切都变得很糟糕,上面的错误消息不是很有帮助。有人有什么想法吗?

最佳答案

我发现内部异常提供了更多详细信息。就我而言,我必须将 NHibernate.ByteCode.CaSTLe.dll 文件添加到引用中。

关于nhibernate - 模糊的 NHibernate/Fluent NHibernate 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/748044/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com