Re: "Insufficient state to deserialize the object" error

From: John Olbert (someone_at_snet.net)
Date: 01/20/05

  • Next message: Ken Kolda: "Re: "Insufficient state to deserialize the object" error"
    Date: Thu, 20 Jan 2005 10:35:03 -0800
    
    

    Thanks.

    I tried using the .NET Configuration Tool to give the mapped drive Full
    Trust but that did not solve the problem. I will work on the name question
    but it does raise another question.

    The line that throws the exception is--
    iConnect.ElanAsynchResponse += new
    Sciex.Elan.INexusLayer.ElanResponseHandler(this.ElanRemoteResponse);

    This is the Client side subscribing to an event on the Server but is not the
    actual execution of the event. What is passed during the subscription process
    that requires serialization?

    Again, any help would be appreciated. I definitely appreciate what you have
    sent.

    --John
    javo2000@snet.net

    "Ken Kolda" wrote:

    > If any of the assemblies are being loaded from the mapped drive, I believe
    > this could be a problem. .NET generally loads loads these types of
    > assemblies with less than full trust, which can cause errors during
    > serialization/deserialization.
    >
    > That said, your issue of multiple assemblies with the same name sounds
    > potentially problematic as well. I wasn't able to follow exactly which
    > classes/interfaces are defined in which assembly, but if any of your remoted
    > types (either serializable or marshal-by-ref) are defined in either of the
    > assemblies with the same name, this could likely be the cause of your
    > problems. When an object is serialized or passed by reference, it includes
    > the name of the assembly in which it resides. If the assembly with that name
    > doesn't contain the specified class when it's received on the other end,
    > you'll certainly get an error.
    >
    > Ken
    >
    >
    > "John Olbert" <someone@snet.net> wrote in message
    > news:8212261F-5111-4841-B8AF-8551B33E5BD9@microsoft.com...
    > > Ken--
    > > I wanted to add another item to the first reply.
    > >
    > > The team that wrote and setup this project also is using a locally mapped
    > > drive. The drive X: is assigned to the location of the Server using the
    > > following Bat file code in Dos--
    > > subst x: /d
    > > subst x: "c:\elan 3.3"
    > >
    > > This may also be connected to the problem. Unforunately we do not control
    > > this issue either.
    > >
    > > Thanks again.
    > >
    > > --John Olbert
    > > javo2000@snet.net
    > >
    > >
    > > "Ken Kolda" wrote:
    > >
    > > > A couple of things to check:
    > > >
    > > > 1) The object which is represented by "this" in your code should be an
    > > > instance of a class that derives from MarshalbyRefObject.
    > > >
    > > > 2) The server will need to have access to the assembly which contains
    > the
    > > > definition of the class references by "this".
    > > >
    > > > If you want to avoid these two requirements, then you need to create an
    > > > event wrapper class. This class is a MarshalbyRefObject-derived class
    > which
    > > > you would define in an assembly that would be shared by the client and
    > > > server. It basically exposes a method to receive the event callback and
    > then
    > > > forwards that call on to your non-remotable class.
    > > >
    > > > If you need additional details, or if this doesn't solve the problem,
    > post
    > > > back.
    > > >
    > > > Ken
    > > >
    > > >
    > > > "John Olbert" <someone@snet.net> wrote in message
    > > > news:694B0552-DDED-4913-8DF6-2808CD95FBB7@microsoft.com...
    > > > > I have a situation in which a Server exposes an event but when the
    > client
    > > > > tries to add the subscribe to the event the following error is
    > generated--
    > > > > "Insufficient state to deserialize the object. More information is
    > > > needed."
    > > > >
    > > > > The Client side code is below--
    > > > >
    > > > > public INexusToTerrapin iConnect = null;
    > > > > public INexus()
    > > > > {
    > > > > try
    > > > > {
    > > > > HttpChannel myChannel = new HttpChannel(0);
    > > > > ChannelServices.RegisterChannel(myChannel);
    > > > > iConnect =
    > > > >
    > > >
    > (INexusToTerrapin)Activator.GetObject(typeof(INexusToTerrapin),"http://local
    > > > host:1234/TerrapinConnectionHelper.soap");
    > > > > iConnect.SetTerrapinToNexus(this);
    > > > > iConnect.ElanAsynchResponse += new
    > > > > Sciex.Elan.INexusLayer.ElanResponseHandler(this.ElanRemoteResponse);
    > > > > }
    > > > > catch (Exception e)
    > > > > {
    > > > > Trace.Write("Terrapin.INexus c'tor error " + e.Message);
    > > > > }
    > > > > }
    > > > >
    > > > > The runtime error (both Server and Client build fine) occurs at the "
    > > > > iConnect.ElanAsynchResponse +=" code.
    > > > >
    > > > > There is a "using" statement and Reference for the namespace and
    > module
    > > > that
    > > > > contains the ElanResponseHandler delegate, the interface
    > INexusToTerrapin
    > > > > and the class that implements the interface (for example the
    > > > > SetTerrapinNexus() function).
    > > > >
    > > > > If the code for the delegate and implementation class is moved into
    > the
    > > > same
    > > > > namespace as the code above everything works fine but if they are in
    > > > separate
    > > > > namespaces this runtime problem occurs.
    > > > >
    > > > > Because of various development constraints we cannot put them in the
    > same
    > > > > namespace.
    > > > >
    > > > > Any help would be appreciated.
    > > > >
    > > > > Thanks.
    > > > >
    > > > > --John Olbert
    > > > > javo2000@snet.net
    > > > >
    > > > >
    > > > > --
    > > > > John Olbert
    > > > >
    > > >
    > > >
    > > >
    >
    >
    >


  • Next message: Ken Kolda: "Re: "Insufficient state to deserialize the object" error"

    Relevant Pages

    • Re: Confusion about .Net AllowPartiallyTrustedCallers (IE).
      ... To get around the security exceptions that occur; ... The assumption is that strong named assemblies will often have more ... more permissions to perform this task. ... have Full Trust. ...
      (microsoft.public.dotnet.security)
    • Re: Tightening the default CAS policy
      ... years now) that Full Trust is a very bad idea, and that we need to move ... partially trusted applications. ... not in itself be sufficient IMHO to increase an assemblies trust permission. ... information and transmits it to some internet site. ...
      (microsoft.public.dotnet.security)
    • Re: Tightening the default CAS policy
      ... years now) that Full Trust is a very bad idea, and that we need to move ... partially trusted applications. ... not in itself be sufficient IMHO to increase an assemblies trust permission. ... information and transmits it to some internet site. ...
      (microsoft.public.dotnet.security)
    • Re: Tightening the default CAS policy
      ... years now) that Full Trust is a very bad idea, and that we need to move ... partially trusted applications. ... not in itself be sufficient IMHO to increase an assemblies trust permission. ... information and transmits it to some internet site. ...
      (microsoft.public.dotnet.security)
    • Code Access Security Best Practices
      ... I am thinking mainly about code running on the local ... limitations with running some of the native .NET system Assemblies ... LinkDemand without Full Trust. ... but remove permissions on a case by case basis ...
      (microsoft.public.dotnet.security)