Print Page | Close Window

Unknown type error when restoring cache state

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2838
Printed Date: 15-Oct-2026 at 1:32pm


Topic: Unknown type error when restoring cache state
Posted By: samir
Subject: Unknown type error when restoring cache state
Date 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!



Replies:
Posted By: sbelini
Date 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 http://drc.ideablade.com/xwiki/bin/view/Documentation/knowntypes - DevForce Resource Center .
 
Silvio.



Print Page | Close Window