Silverlight crashes & disappears - closes debugger - circular reference

Silverlight crashes & disappears - closes debugger - circular reference

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


skagen00 posted on Friday, June 19, 2009

Just because this one was a PITA to diagnose, I just wanted to point out a statement Rocky has made before in a prior post:

"Building a deserializer is really quite difficult even without circular references, and it is non-trivial when circular references are involved. Which is why ***the MobileFormatter doesn’t support circular references***." (Emphasis mine)

I was running my application and a CslaDataProvider wasn't honoring IsInitialLoadEnabled it appeared. Trying to refresh the CslaDataProvider through code would exhibit the problem of just making my Silverlight app crash without contextual help.

Attempting to hit this from within the debugger would cause debugging to just stop (no errors shown) and the window to close. Attempting to hit this from outside the debugger will crash your browser with no helpful information.

My problem was that I had a circular reference that was attempting to get serialized. Debugging Silverlight is a pain at times. (There should almost be a translation dictionary of unhelpful behavior/weird AG_ messages to English!)

skagen00 replied on Friday, June 19, 2009

Here's a question...

why would calling the factory method directly in an asynch fashion from Silverlight work with circular references:
Combined.GetCombined(_combinedIdLookup.CombinedId, CombinedRetrieved);

while using the CslaDataProvider it does not work... (this gives me the nasty behavior described in the initial post)
CslaDataProvider provider = Resources["CombinedDataProvider"] as CslaDataProvider;
provider.FactoryParameters.Clear();
provider.FactoryParameters.Add(_combinedIdLookup.CombinedId);
provider.Refresh();

Copyright (c) Marimer LLC