سؤال

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?

هل كانت مفيدة؟

المحلول 2

I found that there are solution

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

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top