Yeah, finally I work around this. The hibernate.config isn't picked
up.
so I use the below codes to pick the config file
           " Configuration cfg = new Configuration();
            cfg.Configure("hibernate.config");"
Thanks for any reply.

On Sep 1, 1:08 am, Billy Stack <[email protected]> wrote:
> This is because the hibernate-configuration is not being picked up.
>
> Is your hibernate-configuration in a file named "hibernate.config.xml"?
>
> If so ensure "hibernate.config.xml" is copied to the output directory...
>
>
>
> On Mon, Aug 31, 2009 at 8:25 AM, Oskar Berggren<[email protected]> 
> wrote:
>
> > Are you loading the correct config file? (just a quick guess)
>
> > /Oskar
>
> > 2009/8/31 Lychee <[email protected]>:
>
> >> Any one got any ideas with this? Thanks
>
> >> On Aug 28, 2:37 pm, Lychee <[email protected]> wrote:
> >>> I am new to nHibernate and not sure if this is the probably place to
> >>> ask questions.
> >>> I am trying to use nHibernate 2.0.1.4 in .net 3.5 vs 2008. So I create
> >>> a console app, but when I run my console app, I always get the
> >>> following errors,not sure what happens here:
>
> >>> Unhandled Exception: NHibernate.MappingException: Could not compile
> >>> the mapping
> >>> document: NhibernateProject.TestCase.hbm.xml --->
> >>> System.InvalidOperationEx
> >>> ception: Could not find the dialect in the configuration
> >>>    at NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props)
> >>>    at NHibernate.Cfg.Configuration.AddValidatedDocument
> >>> (NamedXmlDocument doc)
> >>>    --- End of inner exception stack trace ---
> >>>    at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
> >>>    at NHibernate.Cfg.Configuration.AddValidatedDocument
> >>> (NamedXmlDocument doc)
> >>>    at NHibernate.Cfg.Configuration.ProcessMappingsQueue()
> >>>    at NHibernate.Cfg.Configuration.AddDocumentThroughQueue
> >>> (NamedXmlDocument docu
> >>> ment)
> >>>    at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader,
> >>> String name
> >>> )
> >>>    at NHibernate.Cfg.Configuration.AddInputStream(Stream
> >>> xmlInputStream, String
> >>> name)
> >>>    at NHibernate.Cfg.Configuration.AddResource(String path, Assembly
> >>> assembly)
> >>>    at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
> >>>    at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
> >>>    at NhibernateProject.Program.Main(String[] args) in D:\test project
> >>> \Nhibernat
> >>> eProject\NhibernateProject\Program.cs:line 15
>
> >>> The TestCase.hbm.xml is the following:
> >>> <?xml version="1.0" encoding="utf-8"?>
> >>> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
> >>> assembly="NhibernateProject" default-lazy="false" auto-import="true"
> >>> namespace="NhibernateProject">
> >>>   <class name ="TestCase" table="test_case" lazy="false">
> >>>     <id name ="Id" column="id">
> >>>       <generator class="assigned"></generator>
> >>>     </id>
> >>>     <property name="UserId" column="user_id"></property>
> >>>     <property name="Notation" column="notation"></property>
> >>>   </class>
> >>> </hibernate-mapping>
>
> >>> The Nhibernate.config is the following:
>
> >>> <?xml version="1.0" encoding="utf-8" ?>
> >>> <hibernate-configuration xmlns ="urn:nhiberate-configuration-2.2">
> >>>   <session-factory name="Test">
> >>>     <property name="dialect">NHibernate.Dialect.Sybase11Dialect</
> >>> property>
> >>>     <property
> >>> name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
> >>> property>
> >>>     <property
> >>> name="connection.driver_class">NHibernate.Driver.SybaseOdbcDriver</
> >>> property>
> >>>     <property
> >>> name="connection.connection_string">SRVR=Test;DB=Test_db;
> >>> UID=test;password=test;driver={Sybase System 11}</property>
> >>>     <property name="connection.isolation">ReadUncommitted</property>
> >>>     <property name="show_sql">true</property>
> >>>     <mapping assembly ="NhibernateProject"></mapping>
> >>>   </session-factory>
> >>> </hibernate-configuration>
>
> >>> I also have created a class with name TestCase.cs.
>
> >>> Thanks for any replying.
> >>> Press any key to continue . . .- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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