I have EmployeeEntity
stored in MyCompany.Entities.Employee.dll
and EmployeeMap: ClassMapping<SPListItem>
in MyCompany.Mapping.dll
, both in GAC.
I use mapping-by-code to create ISessionFactory implementation like this:
var config = new Configuration();
// Initialize config code omitted...
var mapper = new ModelMapper();
mapper.AddMapping(typeof(EmployeeMap));
config.AddDeserializedMapping(mapping, "ExampleMapping");
// Exception thrown here:Could not compile the mapping document: ExampleMapping
// InnerException:persistent class KT.NHibernate.Mapping.Entities.Employee, KT.Nhibernate.Mapping.Entities not found
return config.BuildSessionFactory();
How should I properly configure Configuration instance to use GAC assemblies in my mapping?
I found that there are solution