New Posts New Posts RSS Feed: Unknown type error when restoring cache state
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Unknown type error when restoring cache state

 Post Reply Post Reply
Author
samir View Drop Down
Newbie
Newbie


Joined: 30-Mar-2011
Posts: 14
Post Options Post Options   Quote samir Quote  Post ReplyReply Direct Link To This Post Topic: Unknown type error when restoring cache state
    Posted: 19-Jul-2011 at 2:48pm
Hello.
 
I´m trying to restore a database snapshot to use as design-time data while working with Blend. I´ve succesfully done this
on a previous project with 4 entities using the following code in my ViewModel:
if (DesignerProperties.IsInDesignTool)
{
    // query local cache only
    Manager.DefaultQueryStrategy = QueryStrategy.CacheOnly;
 
    // load snapshot
    var sr = Application.GetResourceStream(new Uri("Director;component/Assets/director.db"UriKind.Relative));
    Manager.CacheStateManager.RestoreCacheState(sr.Stream, RestoreStrategy.Normal);
}
 
Now I´m trying to do the same in a new project that so far has only one entity, however I get this error when opening the View that uses the ViewModel in Blend:
 
Error in line 1 position 1615. Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data of the
'http://schemas.datacontract.org/2004/07/Manutencao.Models:Usuario' data contract. The deserializar has no knowledge of any type
that maps to this contract. Add the type corresponding to 'Usuario' to the list of known types - for example, by using the
KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.
 
Can anyone help me with this?
 
Thanks!
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 25-Jul-2011 at 8:57am
Hi Samir,
 
Does the Usuario type implement the IdeaBlade.EntityModel.IKnownType marker interface? By the error message, this seems to be the issue.
 
You will find detailed information about the known type primer in the DevForce Resource Center.
 
Silvio.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down