Avatar of TundeMajor
TundeMajorFlag for Nigeria asked on

NHibernate: getting nhibernate.configuration exception when using nhybirnate-mapping objects,

I'm using NHibernate on vsts 2005 with SQL Server 2005 and in my web.config file I have something like this
<mapping  resource  ="employee.hbm.xml"  assembly="ImageSite" />
but i keep getting  this exception: Resource not found: employee.hbm.xml
cant figure out what i m doing wrongly.
.NET ProgrammingAssemblyASP.NET

Avatar of undefined
Last Comment
TundeMajor

8/22/2022 - Mon
anmalaver

Hi!

Have you generated those xml mappings...?
ASKER
TundeMajor

you mean employee.hbm.xml , the file i created. the code is attached
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="ImageSite" assembly="ImageSite">
  <class name="employee" table="employee">
     
    <id name="pin">
      <column name="pin" sql-type="nvarchar(50)" not-null="true" />
      <generator class="native" />
    </id>    
    <property name="firstname">
      <column name="firstname" sql-type="nvarchar(50)" length="50" not-null="false" />
    </property>  
    <property name="lastname"> 
      <column name="lastname" sql-type="nvarchar(50)" length="50" not-null="false" />
    </property>
    <property name="othername">  
    <column name="othername" sql-type="nvarchar(50)" length="50" not-null="false" />
    </property>   
    <property name="age"> 
      <column name="age" sql-type="int"   not-null="false" />
    </property> 
  </class>
</hibernate-mapping>

Open in new window

ASKER CERTIFIED SOLUTION
TundeMajor

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes