开发者

InvalidOperationException from HbmJoinedSubclass in NHibernate 3 on Mono 2.8

开发者 https://www.devze.com 2023-02-08 19:13 出处:网络
I\'m trying to run my app on Mono and I\'m getting the following error. It used to run fine on Windows/.NET 4. All I\'ve changed is the config to use MySQL instead of SQL Server.

I'm trying to run my app on Mono and I'm getting the following error. It used to run fine on Windows/.NET 4. All I've changed is the config to use MySQL instead of SQL Server.

Any ideas what is going on here?


Server Error in '/' Application

To be XML serializable, types which inherit from IEnumerable must have
an implementation of
Add(NHibernate.Cfg.MappingSchema.HbmJoinedSubclass) at all levels of
their inheritance hierarchy.
System.Collections.Generic.IEnumerable`1[[NHibernate.Cfg.MappingSchema.HbmJoinedSubclass,
NHibernate, Version=3.0.0.1002, Culture=neutral,
PublicKeyToken=aa95f207798dfdb4]] does not implement
Add(NHibernate.Cfg.MappingSchema.HbmJoinedSubclass).

Description: HTTP 500. Error processing request.

Stack Trace:

System.InvalidOperationException: To be XML serializable, types which
inherit from IEnumerable must have an implementation of
Add(NHibernate.Cfg.MappingSchema.HbmJoinedSubclass) at all levels开发者_运维百科 of
their inheritance hierarchy.
System.Collections.Generic.IEnumerable`1[[NHibernate.Cfg.MappingSchema.HbmJoinedSubclass,
NHibernate, Version=3.0.0.1002, Culture=neutral,
PublicKeyToken=aa95f207798dfdb4]] does not implement
Add(NHibernate.Cfg.MappingSchema.HbmJoinedSubclass).
 at System.Xml.Serialization.TypeData.get_ListItemType () [0x00230]
in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/System.XML/
System.Xml.Serialization/TypeData.cs:366
 at System.Xml.Serialization.TypeData.get_ListItemTypeData ()
[0x00016] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/
System.XML/System.Xml.Serialization/TypeData.cs:298
 at System.Xml.Serialization.TypeData..ctor (System.Type type,
System.String elementName, Boolean isPrimitive,
System.Xml.Serialization.TypeData mappedType,
System.Xml.Schema.XmlSchemaPatternFacet facet) [0x00104] in /private/
tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/System.XML/
System.Xml.Serialization/TypeData.cs:94
 at System.Xml.Serialization.TypeData..ctor (System.Type type,
System.String elementName, Boolean isPrimitive) [0x00000] in <filename
unknown>:0
 at System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type
runtimeType, System.String xmlDataType) [0x00241] in /private/tmp/
monobuild/build/BUILD/mono-2.8.2/mcs/class/System.XML/
System.Xml.Serialization/TypeTranslator.cs:243
 at System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type
type) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/
class/System.XML/System.Xml.Serialization/TypeTranslator.cs:163
 at
System.Xml.Serialization.XmlReflectionImporter.GetReflectionMembers
(System.Type type) [0x00244] in /private/tmp/monobuild/build/BUILD/
mono-2.8.2/mcs/class/System.XML/System.Xml.Serialization/
XmlReflectionImporter.cs:774
 at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping
(System.Xml.Serialization.TypeData typeData,
System.Xml.Serialization.XmlRootAttribute root, System.String
defaultNamespace) [0x0007a] in /private/tmp/monobuild/build/BUILD/
mono-2.8.2/mcs/class/System.XML/System.Xml.Serialization/
XmlReflectionImporter.cs:343
 at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping
(System.Xml.Serialization.TypeData typeData,
System.Xml.Serialization.XmlRootAttribute root, System.String
defaultNamespace) [0x0006e] in /private/tmp/monobuild/build/BUILD/
mono-2.8.2/mcs/class/System.XML/System.Xml.Serialization/
XmlReflectionImporter.cs:217
Version information: Mono Runtime Version: 2.8.2 (tarball Tue Jan 4
15:08:58 MST 2011); ASP.NET Version: 4.0.30319.1


Upgrading to the latest version of NHibernate 3 fixed by problem. I was running on an old alpha release of 3.0... doh!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号