.NET Musings | Wandering thoughts of a developer, architect, speaker, and trainer

.NET Musings

Wandering thoughts of a developer, architect, speaker, and trainer

NAVIGATION - SEARCH

Bug in NHibernate 2.0 Beta 1 relating to Custom Types - Resolved in Beta 2

Started working with NHibernate last week, and while hooking up my POCO to
SQL Server TimeStamp field type, found a bug in the 2.0 (Beta 1) code base.

In the CustomType class constructor, the name field is getting set to the
userTypeClass.Name property (line 33).

This causes an exception to be thrown when NHibernate tries to use your
custom type since it can't get to it if not fully qualified.

The fix is simple:

change:
name = userTypeClass.Name;
to
name = userTypeClass.AssemblyQualifiedName;

Update (14-July-2008): This has been resolved in the 2.0 Beta 2
code base.


Happy Coding!

Managed Windows Shared Hosting by OrcsWeb