I recently converted my solution to VS2010 and .NET 4 and am getting a weird error
I recently upgraded my project to the RC of VS2010 and .net 4. I also added a few additional fields to my 'User' model to include a password, salt, securityquestion, and securityanswer fields all of which are strings. I've switched from getting the source to running the RTM version as well, and I've seen odd behavior of getting a popup when I run the project asking me to open a FluentConfiguration.cs file
I've attached my mapping configuration file, the mapping overrides, and my model
Any assistance is greatly appreciated.
When I try and run my unit tests which worked previously I get the following error:
`Initialization method UniversityExchange.DataTests.MappingTests.BookMappingTest.BaseInitialize threw exception. FluentNHibernate.Cfg.FluentConfigurationException: FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
---> NHibernate.MappingException: (XmlDocument)(2,4): XML validation error: The element 'class' in namespace 'urn:nhibernate-mapping-2.2' has incomplete content. List of possible elements expected: 'meta, subselect, cache, synchronize, comment, tuplizer, id, composite-id' in namespace 'urn:nhibernate-mapping-2.2'. ---> System.Xml.Schema.XmlSchemaValidationException: The element 'class' in namespace 'urn:nhibernate-mapping-2.2' has incomplete content. List of possible elements expected: 'meta, subselect, cache, synchronize, comment, tuplizer, id, composite-id' in namespace 'urn:nhibernate-mapping-2.2'.. `
Here's the Stack trace:
NHibernate.Cfg.Configuration.LogAndThrow(Exception exception) NHibernate.Cfg.Configuration.ValidationHandler(Object o, ValidationEventArgs args) System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(ValidationEventHandler eventHandler, Object sender, XmlSchemaValidationException e, XmlSeverityType severity) System.Xml.Schema.XmlSchemaValidator.CompleteValidationError(ValidationState context, ValidationEventHandler eventHandler, Object sender, String sourceUri, Int32 lineNo, Int32 linePos, XmlSchemaSet schemaSet) System.Xml.Schema.XmlSchemaValidator.InternalValidateEndElement(XmlSchemaInfo schemaInfo, Object typedValue) System.Xml.XsdValidatingReader.ProcessEndElementEvent() System.Xml.XsdValidatingReader.ProcessElementEvent() System.Xml.XsdValidatingReader.ProcessReaderEvent() System.Xml.XsdValidatingReader.Read() System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) System.Xml.XmlDocument.Load(XmlReader reader) NHibernate.Cfg.Configuration.LoadMappingDocument(XmlReader hbmReader, String name) NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc, String name) NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc) FluentNHibernate.PersistenceModel.Configure(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs: line 189 FluentNHibernate.Automapping.AutoPersistenceModel.Configure(Configuration configuration) in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoPersistenceModel.cs: line 126 FluentNHibernate.Cfg.AutoMappingsContainer.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\AutoMappingsContainer.cs: line 71 FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\MappingConfiguration.cs: line 56 FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 110 FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 119 FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 93 FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 98 UniversityExchange.DataTests.SQLiteDatabaseScope
2.BuildConfiguration() in C:\Web Projects\UniversityExchange\Trunk\Src\Tests\DataTests\SQLiteDatabaseScope.cs: line 25
UniversityExchange.DataTests.SQLiteDatabaseScope2..ctor() in C:\Web Projects\UniversityExchange\Trunk\Src\Tests\DataTests\SQLiteDatabaseScope.cs: line 17 UniversityExchange.DataTests.TestingBase.BaseInitialize() in C:\Web Projects\UniversityExchange\Trunk\Src\Tests\DataTests\TestingBase.cs: line 27
- classes.zip 24.2 KB
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Marcus King on 21 Mar, 2010 12:38 AM
I was able to finally figure it out after converting back to running off the source dll's.
I added some additional validation classes to the same assembly that my model and mappings were located. When I did an auto map I was doing it to based on that assembly and since my validation classes weren't part of the model that needed to be mapped it was throwing an error.
Thanks anyway!
Keep up the good work, I love Fluent NHibernate!
Paul Batum closed this discussion on 21 Mar, 2010 05:11 AM.