System.Reflection.TargetInvocationException in Disconnected API

5 posts, 0 answers
  1. Kyaw Zayar Han
    Kyaw Zayar Han avatar
    5 posts
    Member since:
    Sep 2009

    Posted 11 Sep 2009 Link to this post

    Hi,

    We are using Telerik OpenAccess disconnected API for our application, with WCF.  Even though it managed to retrieve objects from database at server site and client site received changeset exactly the same length from server site, we encountered the following error when we load changeset to objectcontainer. It doesn't happen on all module but we can't fix this on a module, no matter what. The object graph contains 3, 4 level of object composition. The only exception is if we don't have any data in database for child object. it works.

    Could you please help us to define problem and get soluction?

     "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> 
      System.TypeLoadException: Type "ANameSpace.Atype' could not be found.
       at Telerik.OpenAccess.RT.TypeResolver.AssociateTypeName(String dotnetname, Boolean complain)
       at Telerik.OpenAccess.RT.TypeResolver.ResolveTypeName(String dotnetname, Boolean complain)
       at Telerik.OpenAccess.RT.DisconnectedStateManager..ctor(SerializationInfo info, StreamingContext context)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
       at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
       at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
       at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
       at System.Runtime.Serialization.ObjectManager.DoFixups()
       at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
       at Telerik.OpenAccess.ObjectContainer.Unwrap(ChangeSet cs)
       at Telerik.OpenAccess.ObjectContainer.Apply(ChangeSet changes)

    Regards,
    Han

  2. Kyaw Zayar Han
    Kyaw Zayar Han avatar
    5 posts
    Member since:
    Sep 2009

    Posted 11 Sep 2009 Link to this post

    A Ha,

    Let me answer my question myself. .NET Runtime didn't load the reference assembly, because we never use any type from target assembly directly. 

    Cheers!
  3. DevCraft banner
  4. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 11 Sep 2009 Link to this post

    Hello Kyaw Zayar Han,
    Perfect analysation.

    Can you just have an instance of one type that is defined in your persistent classes assembly in the assembly that calls container.Apply? That will solve the problem.

    Greetings,
    Jan Blessenohl
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Gopinath
    Gopinath avatar
    21 posts
    Member since:
    Dec 2011

    Posted 19 Mar 2013 Link to this post

    Hello Team,

    in my scenario, I have a similar issue. The length of the data received from server is not same after applying the changeset into the container. I dont receive any error but simply one object is missing when i query the offline container.

    But when I tried to create new container and apply the same changeset, the length seems to be correct,
    I confirmed that the missing objects are really available in the database. Do you have any idea of this issue?

    Thanks,
    Gopi
  6. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 20 Mar 2013 Link to this post

    Hello,
    Are you talking about the amount of objects in the object container? Usually you do a:

    ObjectContainer.Extent<T>()

    To get all objects of one kind.

    Kind regards,
    Jan Blessenohl
    the Telerik team
    Free Webinar: OpenAccess Integration in Sitefinity. SIGN UP NOW.
Back to Top
DevCraft banner