Hi,
We recently upgraded to NH 3.2.0 and converted our existing maps to
use Mapping by Code.
One of our components is hosted inside a third party product and we
deploy our mapping assembly to the GAC in order for the assembly to be
available to this product.
When we started to use Mapping by Code, the third party product was no
longer able to load the mapping assembly from the GAC. The reason for
this was that the “assembly” property of the HbmMapping instance
contained only the simple name of the assembly (e.g. “MyAssembly”) and
not the full name (e.g. “MyAssembly, Version=1.2.1900.0,
Culture=neutral, PublicKeyToken=a14f3033def15840”).
As a workaround we had to manually override the assembly property of
the generated HbmMapping instance, like this:
var compiledMapping =
mapper.CompileMappingForAllExplicitlyAddedEntities();
compiledMapping.assembly =
typeof(MyClass).Assembly.GetName().FullName;
return compiledMapping;
Is this behavior by design, or should
CompileMappingForAllExplicitlyAddedEntities have used FullName as
default?
Regards,
Sverre