Search code examples
nhibernatebuildnugetnhibernate-validator

upgrading NHibernate and NHibernate Validator w/ Nuget


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


Solution

  • 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)