Question

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?

Was it helpful?

Solution 2

I found that there are solution

mapping.assembly = "MyCompany.Entities.Employee assembly strong name";

OTHER TIPS

This has nothing to do with GAC. You need to catch the exception and look at the inner exception to find out what is wrong - probably something in the mapping.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top