-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: why my appliction can not read hibernate.cfg.xml
PostPosted: Mon Jun 27, 2005 5:05 am 
my appliction post the following error:
The hibernate.connection.driver_class must be specified in the NHibernate configuration section


my configure file:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.0" >
<session-factory name="NHibernate.Test">
<!-- properties -->
<property name="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="hibernate.connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="hibernate.connection.connection_string">Server=localhost;initial catalog=leopold;User ID=leopold;Password=password;Min Pool Size=2</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="use_outer_join">true</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<!-- mapping files -->
<mapping assembly="Demo" />
</session-factory>

</hibernate-configuration>



and I put this file in the root direction of the assembly;

please help


Top
  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 11:01 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
"in the root direction of the assembly" ???
I assume that you are using Configuration.Configure().

You must put the "hibernate.cfg.xml" in your "working" directory, that is where your compiled assemblies are (like /bin/Debug/ or /bin/Release/).

You can put it in your project directory (where your source code is) and add:
Code:
copy /y "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml"

in the properties of your project (in "PreBuildEvent" or "PostBuildEvent")

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.