I have a winforms application that uses nhibernate, nhibernate.validator and other libraries.
When I run the standalone winforms aplication, everything works like a charm.
But when I try to run my test cases using Nunit, it fails to load an assembly:
RManager.Tests.Model.AgentTest (TestFixtureSetUp): SetUp : System.TypeInitializationException : O inicializador de tipo de 'NHibernate.Validator.Event.NHibernateSharedEngineProvider' acionou uma exceção. ----> System.IO.FileLoadException : cannot load file or assembly 'NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' . (Exceção de HRESULT: 0x80131040)
The strange thing is that nhibernate is a dependency on almost everything, but they use version 4.0.0.4000.
Every project has a redirect:
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000" />
</dependentAssembly>
How can I figure out what is going wrong? As it appears that the problem is only when running under nunit.
Thank you