Annotated NHibernate entity classes can not be processed by Silverlight RIA services.

Description

Silverligh RIA Services internal code generator fails on attempt to process annotated NHibernate entities.

It appears that RIA Services code generator tries to read annotation attributes before the annotation class is properly initialized.

Here is a typical error spot from ClassAttribute.cs (there are many more of them):

public virtual System.Type NameType
{
get
{
return System.Type.GetType( this.Name );
}
...
}

The GetType() method throws a NPE because the Name is null.

A simple fix that worked for me was just to check the name for null value before calling the GetType:

return this.Name != null? System.Type.GetType( this.Name ) : null;

Environment

None

Activity

Show:

Alex Zaytsev May 18, 2017 at 11:57 PM

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created November 12, 2009 at 7:20 AM
Updated May 18, 2017 at 11:57 PM
Who's Looking?