Fluent NuGet messed up - nhibernate

I have a solution with several projects. I changed a couple of references for Fluent nHibernate to NuGet packages (v1.3.0.717). Recently I changed another project and added the current Fluent package, 1.2.0.712 (earlier but current) and my app will build but not run. The current version points to nHibernate v3.1.0.4 but somewhere it clashes with v3.2.9.4000 which the previous version of Fluent referenced.
Inner Exception
{"Could not load file or assembly 'NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"
NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4"}
Exception
Could not load file or assembly 'NHibernate, Version=3.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
What do I do to clean this project up and get it running again?

Just remove all NHibernate/Fluent Nhibernate related packages and run command
Install-Package FluentNHibernate -Version 1.3.0.717
It will install correct package for you.
For some reason this package is not marked as current version. That is why Nuget gives you old one.

Related

Imageresizer Faces Plugin Error

After installing this both manually and via the package manager I continue to see this error. I was wondering if any of you have encountered this. I get this when I use the ?f.detect=true.
{"dx":0.0,"dy":0.0,"dw":800.0,"dh":510.0,"ow":800.0,"oh":510.0,"cropx":0.0,"cropy":0.0,"cropw":800.0,"croph":510.0,"features":null,"message":"Could
not load file or assembly 'OpenCvSharp, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=6adad1e807fea099' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)"}

.Net core MsBuild UsinTask throws System.runtime version=4.1.0.0 or could not load file or one of its dependencies

I am trying to register my own ms build task, but I am getting
The "MyTask" task could not be loaded from the assembly Path/TasksAssembly.dll. Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Does someone runed into this problem? Why does it search for System.Runtime 4.1.0.0?
In the dependencies of Microsoft.Build 15.1.1012 I am seeing System.Runtime 4.3.0.

Error loading one of the NHibernate dependent dll's

I am building an application using NHibernate. Because I could not add the DLL's of my current version of NHibernate (I cannot add reference when framework 4.0 is target).
I tried to get the latest and greatest of the w.w.w., this is what I have now:
NHibernate.dll (3.2.0.4000)
NHibernate.ByteCode.Castle (3.0.0.4000)
FluentNHibernate.dll (1.2.0.694)
Castle.Core (2.5.2.0)
Castle.Services.Logging.NLogIntegration (2.5.2.0)
Antlr.Runtim (3.1.3.42154)
Iesi.Collections (3.2.0.400)
These I can reference and build my solution with. I know there are some issues with the copying/loading of the dll.s so I made them deployment items.
But run-time I (still) get the following:
NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class.
Possible causes are:
- The NHibernate.Bytecode provider assembly was not deployed.
- The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed.
Solution:
Confirm that your deployment folder contains one of the following assemblies:
NHibernate.ByteCode.LinFu.dll
NHibernate.ByteCode.Castle.dll ---> System.TypeLoadException: Method 'IsProxy' in type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory' from assembly 'NHibernate.ByteCode.Castle, Version=3.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' does not have an implementation.
Thoughts anyone?
In response to Vijay Gill’s answer I have decided to take a different tack.
NUGet packages, a one-stop shop, and easy updates!
There is a FluentNHibernate package out there. I have installed it but I guess there is something amiss here too:
Test method CoreDatabaseTests.CreateCoreDatabase threw exception:
System.IO.FileLoadException: Could not load file or assembly 'NHibernate, Version=3.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
With NHibernate 3.2 you don't need NHibernate.ByteCode.Castle anymore, which considerably simplifies your dependency tree.
Getting components from various locations in such cases is nto a good idea, you compile everything from scratch. Well that's my experience so far. Fluent NH has not been updated to NH 3.2GA.
I would suggest you to download fluent NH and stick with the version that comes with it OR if you want to be on the bleeding edge, download the sources of fluent NH and compile with references set to latest NH (3.2GA).

Fluent NHibernate and NHibernate version issue

Could not load file or assembly 'NHibernate, Version=3.2.0.2002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The system cannot find the file specified.
This could be caused by a number of things, but the most probable cause is that your start up project does not reference the assembly 'NHibernate, Version=3.2.0.2002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' although other assemblies you have referenced use the assembly.
Add the assembly to the start up project and you shall be fine.
And please try to ask questions in a better manner.
It seems FHN has not a build for NH 3.2 yet, because it's in RC state right now.
So you can use asm binding redirect for now.

Odd Exception when Combining .hbm.xml and Fluent NHibernate - Any ideas?

So I'm converting my mapping files on an as needed basis (when making
changes, convert to mapping). Any when configuring NHibernate like so:
Assembly asm = Assembly.Load("RPMWare.Core.DataAccess");
//NHibernate configuration: see hibernate.cfg.xml
var cfg = new Configuration();
cfg.AddMappingsFromAssembly(asm);
cfg.Configure();
And running my web-application I get the following exception:
Could not load file or assembly 'NHibernate, Version=2.0.0.4000,
Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
However, all my integration tests are working as expected. Any ideas?
Nevermind. If you're using the latest version of Fluent NHibernate and the lastest version of NHibernate you need to add YOUR VERSION of NHibernate to the Fluent NHibernate project before building.