I have a project using NHibernate (version 2.2). For upgrade to NHibernate 3.2 , What should I do?
Do I need that upgrade following dlls?
NHibernate.Linq.dll
Iesi.Collections.dll
Castle.Core.dll
Castle.DynamicProxy2.dll
Log4net.dll
Do I need that upgrade hbm files? Do I need that upgrade hibernate.cfg.xml file?
When upgrading to NH 3.2 you don't need NHibernate.Linq.dll anymore, but method name that is used to get LINQ support is not Linq<T> - its Query<T> now
You don't need to change hbm files
You will need to update Iesi.Collections assembly
You don't need castle.dynamic proxy dll (you still can use it, but its not required anymore)
Log4Net is not required anymore
You will probably need to change your cfg file in order to change dynamic proxy settings
The easiest way to get latest version of NH with all required assemblies is to use Nuget
upgrade the dlls and test your program, normally this should be enough
Related
I have an app that uses both NHibernate and Crystal Reports, NHibernate.dll reference Log4Net 1.2.10.0 (PublicKeyToken=aa95f207798dfdb4)
After upgrading Crystal to ver 13.0.2000 we now have a problem, crystaldecisions.shared.dll now references Log4Net 1.2.10.0 as well, but it seems that the good folk at Crystal Decisions have made the "interesting" decision to recompile 1.2.10.0 leaving the version number the same, but giving it a new public key (692fbea5521e1304) and installed it into the GAC.
So my question is...How to install these log4net assemblies side by side? or trick one of the other assemblies (NHibernate or Crystal) into using the other one.
You should be able to install the standard log4net into the GAC as well. This will allow both versions to be loaded by the assembly loader. Alternately you could recompile NHibernate to use the version crystal does, but you'd have to do that from now on moving forward, so I wouldn't recommend it.
I have a project by NHibernate (version 2.1). For upgrade to NHibernate 3.2, what should I do?
Do I need that upgrade following dll?
Antlr3.Runtime
Castle.Core
Castle.DynamicProxy2
NHibernate.ByteCode.Castle
I could not find those dll in NHibernate 3.2. Now what should I do?
They are not needed any more. Just delete all dlls that are not there any more (except maybe log4net, that's now optional but without it there won't be any logging).
You might also get errors in your hibernate.cfg.xml, just remove the deleted elements like ProxyFactoryFactory.
I'm trying to migrate from NHibernate 2.1 to NHibernate 3.1. The FluentNHibernate 1.2 download contains lots of NHibernate dlls, as if it is trying to bundle everything required for NHibernate. But it doesn't seem to contain log4net. Does anyone know why? Is there something I'm missing here? Is log4net not strictly necessary?
Edit: it also doesn't contain the bytecode providers for LinFu or Spring, only Castle. Is there a reason for that too?
NHibernate 3.1 does not require log4net. If uses it if available.
Also, it includes its own bytecode provider, so the external ones are not needed anymore either.
As of the today, the Nuget release of NHibernate Validator is 1.3.1.4000 and says it has a dependency >= NHibernate 3.1.0.4000, which implies it should work with latest NHib 3.2.
But NHib 3.2 now has its own ProxyFactory, so running the two gets the following error:
System.TypeLoadException : Could not load type 'NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException' from assembly 'NHibernate, Version=3.2.0.2001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'
I do not really need anything in NHib 3.2 now, although my preference would be to make the two work together.
Alternatively, I suppose I could drop down to NHib 3.1, but my solution has 16 projects, which where Nuget comes in. This post suggests how to get and install an older package release, but NHib 3.1 doesn't seem to be available stand alone from Nuget.
Installing Validator alone using Nuget will install the NHib 3.1 as a dependency. I have some projects that don't use Validator but do use NHib alone, and I guess I could install Validator just to get the correct dependency but that isn't a very satisfying solution.
Has anyone got the latest NHib (3.2) working with the latest NHib Validator? Suggestions?
Cheers,
Berryl
If you feel OK about using NHib 3.1 you can first add the Validator + its dependency on NHib 3.1 to the projects that require validation. Afterwards, referencing the NHib package in other projects can be done at the solution level (introduced in NuGet 1.4)
there is a project using nhibernate v2.1 and i have been wondering whether v3 is backwards comatible with 2.1?
I mean if i drop v2.1 dll and replace it with v3 dll would all code work?
thnx for your opinion.
Just made the move recently. There were no "out of the way" breaking changes unlike when having to upgrade from 1.2 to 2.0. In fact we didnt have to change anything in our code when we upgraded from 2.1.2 GA to 3.0
However there are some breaking changes that can be seen in the release notes that accompany the downloads.
In relation to the question you asked with the NHibernate dll:
NHibernate depends on log4net, Castle, Iesi.Collections etc so when you upgrade ensure that these dlls are correct also - We cater for this easily by positioning downlaoded NHibernate binaries in a "lib" repository and all projects that need NHibernate reference the NHibernate.dll in the NHibernate "lib" folder. This then solves the dependency issue as all other necessary NHibernate dependencies are in situ already in the same folder as the NHibernate.dll by default.
It is almost compatible. If you didn't use linq. Read realease info, there is list of breaking changes.