-->
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.  [ 3 posts ] 
Author Message
 Post subject: Generally Question to NHibernate in combination with ASP.NET
PostPosted: Wed Feb 01, 2006 11:19 am 
Newbie

Joined: Wed Feb 01, 2006 9:44 am
Posts: 7
Hi,

i get MappingException from NHibernate that says: "Unknown entity class"

I develop with Visual Web Developer 2005
My Web-Projectname is "SqlExpressTest"
I have two files in the "App_Code"-Folder:
1. "User.cs" --> is embed in a namespace named "NHibernateDemo"
2. "User.hbm.xml" --> in this file are the following tag:

<class name="NHibernateDemo.User, SqlExpressTest" table="users">

===============================================

My generally questions are:

1. A web-app hasn't a subfolder named "\bin" like in normal win-applications...where to compile-time is generated a dll with the name of the project. how can i know in a in web-app beforehand what is the name of the dll to can enrol it in the "User.hbm.xml"-File ???

Furthermore i think the "User.hbm.xml" is not embedded in the assambly, how can i reach it?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 4:18 pm 
Newbie

Joined: Fri Jan 20, 2006 12:47 pm
Posts: 16
Location: Ottawa, On
In the properties for your Web App you can see / set the Assembly name under the General topic, but it should default to the same as your project name.

You need to set the mapping file as an embedded resource in your project. In the Properties for the mapping file, open the Build Action list and pick embedded resource. You then have to rebuild (not build) your solution again to force re-generation of the dll.

After that, NHibernate should find the mapping file and your class.

CHeck out the NHibernate quick start http://www.hibernate.org/362.html


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 05, 2006 8:23 pm 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
in VS.2005 the deployment method for web projects has changed. Instead of having one assembly being built from all your pages, now each page will have its own assembly built individually. In this new model you can't embed a file as a resource like in VS.NET 2003. You have 2 options: build your business logic layer as a separate class library project (though I don't know if this is possible with the VS Express Web Edition) or load your mapping files manually at runtime.

cheers,
radu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.