New Posts New Posts RSS Feed: Attempting to mock data at *design* time
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Attempting to mock data at *design* time

 Post Reply Post Reply Page  <12
Author
mikedfox View Drop Down
Newbie
Newbie


Joined: 29-Apr-2010
Posts: 21
Post Options Post Options   Quote mikedfox Quote  Post ReplyReply Direct Link To This Post Topic: Attempting to mock data at *design* time
    Posted: 06-Dec-2010 at 10:46am
thanks Ward, that did the trick
Back to Top
Wayne View Drop Down
Newbie
Newbie


Joined: 14-Feb-2010
Location: Florida
Posts: 3
Post Options Post Options   Quote Wayne Quote  Post ReplyReply Direct Link To This Post Posted: 26-Dec-2011 at 2:23pm
Following this thread with version 6.1.3 in a Silverlight app - loading from cache works fine at runtime but in Blend (design time) this line now seems to cause a failure:
IdeaBlade.Core.IdeaBladeConfig.Instance.ProbeAssemblyNames.Add(typeof(NorthwindIBEntities).Assembly.FullName);
Debugging Blend design time with VS2010 - Blend cannot seem to figure out whether to add the assembly name to 
IdeaBlade.Core or IdeaBlade.Core.SL (common names inside)
So the line fails and so then 
EntityCacheState.Restore(res.Stream)
 
fails too with null exceptions for each field and record during the load.
Is there a work-around to add the assembly full names ?
Thank you in advance.
 
 
 
Back to Top
WardBell View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
Post Options Post Options   Quote WardBell Quote  Post ReplyReply Direct Link To This Post Posted: 26-Dec-2011 at 9:53pm
Are you sure about the cause that you have identified? Could it be a null exception encountered during deserialization.Have you loaded Silverlight 5 by chance?
I ask because there is a critical serialization bug in the Silverlight 5 release (RTW) acknowledged by Microsoft; apparently they took a dependence on a serialization method that does not exist in desktop .NET 4. "So what?" Well both Cider and Blend are actually running desktop .NET 4 when they display your Silverlight XAML. Too bad for all of us; serialization does not work.
 
Microsoft has no intention of "fixing" SL 5 to address this. They have advised us that the developer should either revert to SL 4 (remove all SL 5 from the machine) or hang on for .NET 4.5; you can try a CTP of .NET 4.5.
 
Frankly, we don't think any of these workarounds are appropriate. We are trying to find something else to recommend; no luck so far.
 
It doesn't look good for designing with data that has been restored from an Entity Cache file ... or for any tactic that involves (de)serialization.
 
For now we suggest that you create design data dynamicall with a "Data Mother" class: a class that instantiates design-time entities and populates an offline EntityManager; these become the data source for design time data binding.
 
We regret the (temporary) loss of the entity cache file feature. I wish we knew a way around it. I'll certainly let you know if we come up with something.
 
Root for .NET 4.5 I guess.
 
If this is not the immediate cause of your problem and you are willing to live entirely in SL 4, please post again with more detail and we can get you going.
Back to Top
Wayne View Drop Down
Newbie
Newbie


Joined: 14-Feb-2010
Location: Florida
Posts: 3
Post Options Post Options   Quote Wayne Quote  Post ReplyReply Direct Link To This Post Posted: 26-Dec-2011 at 11:38pm
Interesting - I had installed Silverlight 5 but then uninstalled it and went back to Silverlight 4 on this development machine.
 
Additional - while stepping though each line after asking Blend to open User Control for designing -
 
IdeaBlade.Core.IdeaBladeConfig.Instance.ProbeAssemblyNames.Add(typeof(NorthwindIBEntities).Assembly.FullName);
is the first line of code that fails (subsequent  deserialization also fails) - but executing the code to use the design data during a regular run and stepping though the code - that line resolves the conflict, succeeds and the cached data load properly.
 
I will look into the possibility are some left overs of Silverlight 5 after reverting back to Silverlight 4.
 
Is there an example of the "Data Mother" class available that you could share >
 
Thank you for your help.
 
 
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down