Print Page | Close Window

Deserializing array regress ?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3677
Printed Date: 03-May-2025 at 12:39pm


Topic: Deserializing array regress ?
Posted By: Walid
Subject: Deserializing array regress ?
Date Posted: 28-Sep-2012 at 2:44am
Hi,

I have an Rpc method returning an IEnumerable<a knowntype> that was right working in DF2010 and now with DF2012 is causing an error with the following message.

Did I miss something ?

Le module de formatage a généré une exception en tentant de désérialiser le message : Une erreur s'est produite en tentant de désérialiser le paramètre http://ideablade.com/EntityModel:InvokeServerMethodResult. Le message InnerException était « L'élément « http://ideablade.com/EntityModel:ReturnObject » contient des données du contrat de données « http://schemas.datacontract.org/2004/07/Common:ArrayOfServiceManager ». Le désérialiseur n'a connaissance d'aucun type mappant à ce contrat. Ajoutez le type correspondant à « ArrayOfServiceManager » dans la liste des types connus, par exemple en utilisant l'attribut KnownTypeAttribute ou en l'ajoutant à la liste des types connus qui est transmise à DataContractSerializer. ». Pour plus d'informations, voir InnerException.




    [DataContract]
    public class ServiceManager : IKnownType
    {
        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string Description { get; set; }

        [DataMember]
        public ServiceStatus Status { get; set; }
    }

        [AllowRpc]
        public static IEnumerable<ServiceManager> GetServiceManagers(IPrincipal principal, EntityManager entityManager, params Object[] args)
        {
            return ServicesControlManager.Instance.GetServiceManagers();
        }







Replies:
Posted By: kimj
Date Posted: 28-Sep-2012 at 11:07am
Hi Walid,
 
DevForce will automatically add a List<T> for any type found that implements IKnownType, and this is unchanged from DF2010.   It sounds like the assembly holding the ServiceManager class hasn't been found by DevForce, so check what's been probed.  See http://drc.ideablade.com/devforce-2012/bin/view/Documentation/discovery - http://drc.ideablade.com/devforce-2012/bin/view/Documentation/discovery  for more info.


Posted By: Walid
Date Posted: 28-Sep-2012 at 11:35am
Devforce found the class :

2012-09-28 20:30:33 IdeaBlade.EntityModel.KnownTypeHelper:<GetMarkedKnownTypes>b__13 Probed for known types and found Common.ServiceManager


Posted By: kimj
Date Posted: 28-Sep-2012 at 2:21pm
The type needs to be known on both client and server.  Is this by any chance a type in a dynamic XAP?
 
 


Posted By: Walid
Date Posted: 28-Sep-2012 at 2:24pm
yes, the file hosting the type is link to an SL assembly dynamically loaded in a xap.



Posted By: kimj
Date Posted: 28-Sep-2012 at 7:39pm
You're right, this is a regression bug in the recomposition logic.  We'll post when we have a fix.


Posted By: Walid
Date Posted: 29-Sep-2012 at 2:32am
ok thanks

this probem could also be related to the issue i told you about the model in a dynamic xap ?
i think marcel said he will investigate on this one


Posted By: kimj
Date Posted: 29-Sep-2012 at 10:01am
This is a DevForce bug, so I'll get in touch with Marcel.  And yes, it is related to your earlier issue with the dynamic XAP.


Posted By: kimj
Date Posted: 08-Oct-2012 at 5:39pm
Just an update for anyone else who ran into this problem - it was fixed in the 7.0.1 release, which is available via NuGet.


Posted By: Walid
Date Posted: 09-Oct-2012 at 12:26am
I confirm,the fix works well.



Print Page | Close Window