Unhandled Error in Silverlight Application One or more properties are not registered for this type

Unhandled Error in Silverlight Application One or more properties are not registered for this type

Old forum URL: forums.lhotka.net/forums/t/9165.aspx


Saumil posted on Friday, July 02, 2010

Hi

I am using CSLA for silverlight and i have this strange issue in our test environment. Everything is running fine in dev environment but same binaries in test environment gives following error....

Please respond soon.....

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Fri, 2 Jul 2010 14:39:50 UTC


Message: Unhandled Error in Silverlight Application One or more properties are not registered for this type   at Csla.Core.FieldManager.FieldDataManager.GetFieldData(IPropertyInfo prop)
   at Csla.Core.BusinessBase.ReadProperty[P](PropertyInfo`1 propertyInfo)
   at Csla.Core.BusinessBase.GetProperty[P](PropertyInfo`1 propertyInfo, NoAccessBehavior noAccess)
   at Csla.Core.BusinessBase.GetProperty[P](PropertyInfo`1 propertyInfo)
   at SecurityModule.Presenters.LoginPresenter.LoadPublications()
   at SecurityModule.Presenters.LoginPresenter.<LoadUser>b__7(Object sender, DataPortalResult`1 e)
   at Csla.DataPortal`1.OnFetchCompleted(DataPortalResult`1 e)
   at Csla.DataPortal`1.proxy_FetchCompleted(Object sender, DataPortalResult`1 e)
   at Csla.DataPortalClient.WcfProxy`1.OnFetchCompleted(DataPortalResult`1 e)
   at Csla.DataPortalClient.WcfProxy`1.proxy_FetchCompleted(Object sender, FetchCompletedEventArgs e)
   at Csla.WcfPortal.WcfPortalClient.OnFetchCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://localhost/urlpath/home.aspx

 

RockfordLhotka replied on Sunday, July 04, 2010

I'm assuming you are using CSLA 3.8 or 4.

If you are using SL4, you need to make your PropertyInfo<T> fields public.

If you are using SL3, you probably should make them public - or use the _forceInit trick discussed in the Expert 2008 Business Objects book.

The problem is that the static fields of your business types aren't being initialized early enough - making the PropertyInfo<T> fields public will solve that because CSLA 3.8 and higher has code to fix the issue. The _forceInit trick works in SL3, but apparently the JIT compiler in SL4 optimizes the code away when in release mode, so that's not a good solution anymore.

Saumil replied on Monday, July 05, 2010

We are using CSLA 3.6 and Silverlight 4.0. after looking at your response i think we should move to CSLA 3.8 or 4.0 with Silverlight 4.0. We are moving to CSLA 3.8 now.

Thanks.

Copyright (c) Marimer LLC