Help Debugging /w More Silverlight Pain

Help Debugging /w More Silverlight Pain

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


Jack posted on Thursday, February 05, 2009

Okay so I've got my bits and pieces connected and I'm trying to get data for a large BO.  I have a number of childListBO's in my BO and when I try to retrieve everything I get the following after my Fetch. 

Type 'System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.

I'm assuming the issue is related to some piece of data I might be using that can't map into Silverlight?  I was able to suppress the loading of all my child objects and I can successfully retrieve my data (big step forward) but other than commenting out and then uncommenting one child object at a time I'm hoping there is an easier way to tell where it is blowing up.

Thanks

jack

Jack replied on Thursday, February 05, 2009

I ended up commenting down the chain but looks like the problem was with List<string> that I was using to collect messages.  I switched it to MobileList<string> and it isn’t crashing there anymore. 

 

I’m now getting a CopyState error after my fetch.  This is a little bit confusing as I’m not sure where this BeginEdit() is coming from… could that be the XAML databinding? 

 

This is the same getBO function call I make in winforms.

 

All I’ve done is binded to a single property.  If I remove all the population of childBOs then it works fine so it is linked somehow.

 

 

 

>             Csla!Csla.Silverlight.CslaDataProvider.Error.set(System.Exception value = {Csla.Core.UndoException: Edit level mismatch in CopyState

   at Csla.Core.UndoableBase.CopyState(Int32 parentEditLevel)

   at Csla.Core.UndoableBase.Csla.Core.IUndoableObject.CopyState(Int32 parentEditLevel, Boolean parentBindingEdit)

   at Csla.BusinessListBase`2.CopyState(Int32 parentEditLevel)

   at Csla.BusinessListBase`2.Csla.Core.IUndoableObject.CopyState(Int32 parentEditLevel, Boolean parentBindingEdit)

   at Csla.Core.FieldManager.FieldDataManager.Csla.Core.IUndoableObject.CopyState(Int32 parentEditLevel, Boolean parentBindingEdit)

   at Csla.Core.BusinessBase.OnCopyState(SerializationInfo state)

   at Csla.Core.UndoableBase.CopyState(Int32 parentEditLevel)

   at Csla.Core.BusinessBase.BeginEdit()

   at Csla.Silverlight.CslaDataProvider.set_ObjectInstance(Object value)

   at Csla.Silverlight.CslaDataProvider.QueryCompleted(Object sender, EventArgs 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)}) Line 271 + 0x26 bytes          C#

 

From: Jack [mailto:cslanet@lhotka.net]
Sent: Thursday, February 05, 2009 4:30 PM
To: jaddington@alexandergracie.com
Subject: [CSLA .NET] Help Debugging /w More Silverlight Pain

 

Okay so I've got my bits and pieces connected and I'm trying to get data for a large BO.  I have a number of childListBO's in my BO and when I try to retrieve everything I get the following after my Fetch. 

Type 'System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.

I'm assuming the issue is related to some piece of data I might be using that can't map into Silverlight?  I was able to suppress the loading of all my child objects and I can successfully retrieve my data (big step forward) but other than commenting out and then uncommenting one child object at a time I'm hoping there is an easier way to tell where it is blowing up.

Thanks

jack


Copyright (c) Marimer LLC