Hi,
I have a solution with 3 projects (the usual GUI / Business / Database
trinity). I have all the hbm files in a folder under the database
project for the purpose of neatness and order.
I get an error when creating the Configuration object:
Configuration cfg = new Configuration();

cfg.Properties["hibernate.connection.provider"] =
"NHibernate.Connection.DriverConnectionProvider";
cfg.Properties["hibernate.dialect"] =
"NHibernate.Dialect.MsSqlCeDialect";
cfg.Properties["hibernate.connection.driver_class"] =
"NHibernate.Driver.SqlServerCeDriver";
cfg.Properties["hibernate.connection.connection_string"] = path;
cfg.AddXmlFile("Mappings\\Project.hbm.xml");
sessionFactory = cfg.BuildSessionFactory();

The error occurs on the 5th line where I add the hbm file:
Themis.Utilities.ThemisException: Failed to open connection to the
application. ---> NHibernate.MappingException: Could not configure
datastore from file Mappings\Project.hbm.xml --->
System.IO.DirectoryNotFoundException: Could not find a part of the
path 'D:\Documents\My Documents\Visual Studio 2010\Projects\Themis
\Themis\bin\Debug\Mappings\Project.hbm.xml'.

D:\Documents\My Documents\Visual Studio 2010\Projects\Themis\Themis\bin
\Debug\ is the path of the GUI project.

The hbm file has the build attribute set to 'EmbeddedResouce'. What am
I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to