CSLA 4 - Preview: Problem Deserializing

CSLA 4 - Preview: Problem Deserializing

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


Curelom posted on Tuesday, April 20, 2010

I'm serializing a BusinessList in CSLA4 preview as follows

            IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
            IsolatedStorageFileStream  fs = isoStore.CreateFile("Commitment.dat");
            System.Runtime.Serialization.Formatters.Binary.BinaryFormatter b = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            b.Serialize(fs, _skuForecastList);
            fs.Close();

I then try to deserialize it and I get an Index was outside  the bounds of the array and a Message "One or more properties are not registered for this type.

I've backed through the code and it is erroring in the GetFieldData of the FieldDataManager.  The property info object being passed in is showing an index of -1.

This property is being registered as so

private static PropertyInfo<SmartDate> WeekStartDateProperty = RegisterProperty(new PropertyInfo<SmartDate>("WeekStartDate", "Week Start Date", new SmartDate(DateTime.Today)));

Could this be related to this issue?

http://forums.lhotka.net/forums/p/6768/33291.aspx#33291

Curelom replied on Tuesday, April 20, 2010

Nevermind.  I tried this using the CSLA MobileFormatter and it works perfect.

Copyright (c) Marimer LLC