Upgrading to NHibernate 2.1.x

July 19, 2009

Yesterday I was upgrading NHibernate to a 2.1.x branch, which will be the next release in the comming months.

The upgrade process was not that extremely difficult, but it was really complex and rather long, as i am using Castle project and NHibernate.Generics

So the overal process was like this:

  1. Checkout Castle trunk, and build it.
  2. Update Castle.DynamicProxy2 and Castle.Core references in NHibernate
  3. build NHibernate
  4. Checkout NHContrib project
  5. Build NHibernate.Search project, which is part of NHContrib. Don’t forget to update references.
  6. Build NHibernate.Linq project, which is also part of NHContrib. For this project i had to use SharpDevelop, since it does not support nant. But everything works nice and clean as usual :)
  7. Update references in Castle project. These were in \SharedLibs folder. And NHibernate.Linq reference was in \SharedLibs\net folder
  8. Successfully build everything with nant
  9. Build NHibernate.Generics

Note that for NHibernate and Castle you have to compile against 3.5 paltform, but the generated assemblies can run on .Net 2.0.   This is done by passing an argument -t:net-3.5  to nant.

So after building everything, had to add proxyfactory.factory_class configuration variable, as described here. Pay  close attention to the fact, that a class assembly is uniquely identified by both it’s name, and it’s assembly name. Since i am using castle, i had to add this line:

property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>

That’s it.  Now i have bulk actions capability and “group by” by IProjection :)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: