b********5 发帖数: 12 | 1 I am trying to develop my own class library for all my web projects.
I created a class project using C# .NET and this project is included the
NHiberniate framework. This class is doing couple very simply think.
1. Create and return the ISessionFactory as a new instance
2. Close the ISessionFactory
And then I include this custom class into my web project and create the
NHiberniate instance and close the instance in the Global.asa file. Also the
NHiberniate configuration file and the database mapp |
d****d 发帖数: 133 | 2 没做过web的,你的configuration在web.config里面?
你的mapping file是不是embedded to resource了?
the
this
the
【在 b********5 的大作中提到】 : I am trying to develop my own class library for all my web projects. : I created a class project using C# .NET and this project is included the : NHiberniate framework. This class is doing couple very simply think. : 1. Create and return the ISessionFactory as a new instance : 2. Close the ISessionFactory : And then I include this custom class into my web project and create the : NHiberniate instance and close the instance in the Global.asa file. Also the : NHiberniate configuration file and the database mapp
|
b********5 发帖数: 12 | 3 I have created a NHiberniate configuration file "Hiberniate.cfg.xml" and the
mapping xml file to the bin directory. But you are making a good point the
the web project should make the Hiberniate.cfg.xml content into the web.
config file. May be this is the reason why my web project have a runtime
error. |
k****i 发帖数: 1072 | 4 Not neccessary. Just trace down the constructor of your NHibernate class to
see what is the config file path. It should provide some way to pass in the
configuration path.
the
the
【在 b********5 的大作中提到】 : I have created a NHiberniate configuration file "Hiberniate.cfg.xml" and the : mapping xml file to the bin directory. But you are making a good point the : the web project should make the Hiberniate.cfg.xml content into the web. : config file. May be this is the reason why my web project have a runtime : error.
|