1
votes

I am using NHibernate at Class Library project. And at attempt to exec Unit tests all database related methods works fine. But when I am trying to use this dll file at say console application I am getting an exception: "An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail."

Final message: "'FluentNHibernate.Automapping.IAutoClasslike, ProjectRelese, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is missing a parameterless constructor."

How it could be possible that the same code works at Nunit and does not work at application side from dll?

1
can you show the Sessionfactory configuration code?Firo

1 Answers

2
votes

We solved the problem. The reason was that FluentNHibernate dll was ILMerged with domain assembly. And when fluent mapped entities, together with domain it tried to map his own classes because founded required interfaces and conventions. So problem was in inappropriate merging, not in fluent or NH.