What NHibernate version works with .NET Framework 4.0?

664 views
Skip to first unread message

cor

unread,
Sep 20, 2013, 2:00:01 PM9/20/13
to nhu...@googlegroups.com
I am new to NHiberate.  I searched on this topic but could not seem to find an answer. 
 
Basically I have an existing .NET C# web application which is using NHibernate.dll version 1.2.0.3002.  I am using Visual Studio 2010.   If I use framework 3.5, the web applications retrieives the data from the database and no errors.   But I need to convert this web app to framework 4.0.  If I do that and then run the app. I get an error on a query using NHibernate.  The attached file gives the error message.
 
The Lines of code:
               IQuery query = NHibernateSession.CreateQuery("from Borrower where RUSBorrowerId = :RUSBorrowerId");
                query.SetString("RUSBorrowerId", borrowerId);
                log.Error("Debug-before-List<Borrower> list = new List<Borrower>(query.List<Borrower>())");
                List<Borrower> list = new List<Borrower>(query.List<Borrower>());  // the line where it errors out
 
Does NHibernate 1.2.0.3002 work with .NET Framework 4.0?  Or do I need to upgrade to a newer version of NHIbernate?  If so, what version?  Or do I need to just make some code changes to get it to work?
 
What versions of NHIbernate work with the different versions of .NET Framework?
 
 
 
QueryErrorMessage.txt

Oskar Berggren

unread,
Sep 23, 2013, 9:06:31 AM9/23/13
to nhu...@googlegroups.com
NH 1.2 is extremely old.
Many use NH 3.x (compiled for .Net 3.5) running on the .Net 4 runtime.

Suggested method of proceeding:
1) Upgrade to NH 3.3.3-SP1.
2) Compile/fix/test etc. so you have that working. There might be breaking changes in NH - read the release notes and test.
3) When you have that working, then you can try moving to .Net 4.

If you need to move the project to the latest .Net platform, it seems like a waste of time to try to figure if/how an ancient version of NH can run on it.

/Oskar





2013/9/20 cor <per...@charter.net>

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+u...@googlegroups.com.
To post to this group, send email to nhu...@googlegroups.com.
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.

cor

unread,
Sep 24, 2013, 11:17:32 AM9/24/13
to nhu...@googlegroups.com
Thanks for your help.  I will do what you suggest.
Reply all
Reply to author
Forward
0 new messages