Can't Compile Correct Mapping File

Posted by NoOne on Stack Overflow See other posts from Stack Overflow or by NoOne
Published on 2010-03-17T20:28:55Z Indexed on 2010/03/17 20:31 UTC
Read the original article Hit count: 324

Filed under:
|
|

Hello, Im now developping one application in C# with Remoting objects and NHibernate. So here is a image explaining how my projects are divided.

alt text

Views Layer

This layer will be responsible for the users interface. This layer will always use the Controls Layer to create and edit objects;

Control Layer

This is my persistence layer, here Ill have all the NHibernate configuration. This is my critic point, because ListSingleton Project will have only my RemoteObject. (Here I have the App.config file)

Models Layer Entity layer. Here I only have the entities classes and their respective mapping.

I’ve done a test solution with no remoting and only with the projects of the Control and Model Layers. It was all working ok.

Now that I added the Views Layer and set the solution to start with projects Client and Server (Client calls the Control Layer and this would do a try to persist a object) I’m getting a error at :

  Configuration cfg = new Configuration();
  cfg.AddXmlFile("mapping/User.hbm.xml");

InnerException:

  {"Could not compile the mapping document: mapping/User.hbm.xml"}

InnerException.InnerException:

 {"Could not find the dialect in the configuration"}

StackTrace in the InnerException.InnerException

 "   em NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props)\r\n   em     NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)"

But I know that there is no error in the mapping file because I used in my test application.

© Stack Overflow or respective owner

Related posts about c#

Related posts about remoting