-->
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.  [ 7 posts ] 
Author Message
 Post subject: Assembly Error, and I don't know why
PostPosted: Fri Jan 06, 2006 12:33 pm 
Newbie

Joined: Fri Jan 06, 2006 12:23 pm
Posts: 11
Hi,

I'm new to nHibernate, this is the first example I'm trying to do, but I can't make it work.

I made a simple aspx page with some fields (Name, Surname, Address), then a class representing that (Person).
I also made a mapping xml and put the nhibernate configuration in the Web.Config.

I load the page, but after I hit the button "Save", the following error appears:

"The located assembly's manifest definition with name 'NHibernate' does not match the assembly reference."


I don't know what's that.

I have organized the Solution in two proyects:

The Web Proyect, and one called Entities.

The entities proyect has the link to the nhbiernate.dll.
And only a file with the Person class.

The class has setters and getters.
And the following method:

<code>

public static void Guardar(Persona _persona)
{

// Configuracion de nHibernate
Configuration cfg = new Configuration();

// Creo una session con la transaccion para que usa nHibernate
ISessionFactory factory = cfg.BuildSessionFactory();
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();

session.Save(_persona);
transaction.Commit();
session.Close();

}
</code>


When that method is triggered, the error appears.


What should I do?


Thanks a lot !!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 1:27 pm 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
This is a standard .net exception when your app refers to different versions of the assembly during compilation and during run-time. (e.g. app is being compiled with NH 0.8.4 and running with 1.0.1).

Look for NHibernate.dll files in the project (in bin folders) and check if versions are equal (you can do it even with windows explorer, - go to file properties and look for version tab)

_________________
michal


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 3:07 pm 
Newbie

Joined: Fri Jan 06, 2006 12:23 pm
Posts: 11
When I see the Properties in the Visual Studio .Net (2003), it says:

"Version: 0.8.0.0".

Then, when I go to /MyApp/Bin/

The NHibernate.dll also says: "Version: 0.8.0.0"


What could be happen?


I also try using the 1.0.1.0 version of nhibernate, but it says the same.


Any idea?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 07, 2006 7:35 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You have an old copy of NHibernate.dll around. Delete all NHibernate.dll's you can find, and try again.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 12:17 am 
Beginner
Beginner

Joined: Mon Jan 09, 2006 8:02 am
Posts: 22
Check Out ur GAC in c:\windows\Assembly. Check out if there is any reefernces added to Nhibernate in there. If it exsits check the version there. Ur Applicaion might be picking up the dll from here. Make sure only One version exsits, the one u want to use. Delete all other nhibernate dlls from here. This should then Work. If u want to use different application with different versions of Hiberrnate u need to create a Key mapping. Let me KLnow if this Helped


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 5:53 am 
Regular
Regular

Joined: Tue Mar 15, 2005 12:38 pm
Posts: 73
Location: Bucharest
This article describes very well how to debug this kind of stuff and proved more than usefull to me:
http://blogs.msdn.com/suzcook/archive/2 ... 57120.aspx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 10:32 am 
Newbie

Joined: Fri Jan 06, 2006 12:23 pm
Posts: 11
Thanks!


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