“NHibernate.Cfg.Configuration”的类型初始值设定项引发异常。

本文提供了解决NHibernate配置错误的方法,并指导如何在项目中添加log4net.dll以优化日志记录。

VS报错:“NHibernate.Cfg.Configuration”的类型初始值设定项引发异常。

解决方法:在程序项目里添加引用一个DLL,log4net.dll


NHibernate.Cfg.HibernateConfigException HResult=0x80131500 Message=An exception occurred parsing configuration :The 'name' attribute is invalid - The value 'command_interceptor' is invalid according to its datatype 'Union' - The value 'command_interceptor' is not valid according to any of the memberTypes of the union. Source=NHibernate StackTrace: 在 NHibernate.Cfg.XmlSchemas.ConfigSettingsValidationEventHandler(Object sender, ValidationEventArgs e) 在 System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity) 在 System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(String code, String[] args, Exception innerException) 在 System.Xml.Schema.XmlSchemaValidator.CheckAttributeValue(Object value, SchemaAttDef attdef) 在 System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String localName, String namespaceUri, XmlValueGetter attributeValueGetter, String attributeStringValue, XmlSchemaInfo schemaInfo) 在 System.Xml.XsdValidatingReader.ValidateAttributes() 在 System.Xml.XsdValidatingReader.ProcessElementEvent() 在 System.Xml.XsdValidatingReader.ProcessReaderEvent() 在 System.Xml.XsdValidatingReader.Read() 在 System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader, XmlSpace space) 在 System.Xml.XPath.XPathDocument..ctor(XmlReader reader, XmlSpace space) 在 NHibernate.Cfg.ConfigurationSchema.HibernateConfiguration..ctor(XmlReader hbConfigurationReader, Boolean fromAppSetting) 在 NHibernate.Cfg.Configuration.Configure(XmlReader textReader) 在 NHibernate.Cfg.Configuration.Configure(String fileName) 在 Nebula.EAP.Core.Scenario.Dao.Session.ReadWriteSessionManager.BuildSessionFactory(String key) 在 F:\ProgramNew\nebula.eap.core\Nebula.EAP.Core.Scenario\Dao\Session\ReadWriteSessionManager.cs 中: 第 75 行 在 Nebula.EAP.Core.Scenario.Dao.Session.ReadWriteSessionManager.<>c.<.cctor>b__3_0() 在 F:\ProgramNew\nebula.eap.core\Nebula.EAP.Core.Scenario\Dao\Session\ReadWriteSessionManager.cs 中: 第 16 行 在 System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) 内部异常 1: XmlSchemaValidationException: The 'name' attribute is invalid - The value 'command_interceptor' is invalid according to its datatype 'Union' - The value 'command_interceptor' is not valid according to any of the memberTypes of the union. 内部异常 2: XmlSchemaException: The value 'command_interceptor' is not valid according to any of the memberTypes of the union.
最新发布
06-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值