SerializationException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news.microsoft.com

    SerializationException

    I have created an add-in for VS.NET and when it starts I want the add-in to
    read the options from file.
    I have created a class (with the [Serializable] attribute set) that contains
    the options and implemented GetObjectData(S erializationInf o info,
    StreamingContex t context) as well as a copy constructor: protected
    Options(Seriali zationInfo info, StreamingContex t context).

    The serialization process definately works. However, on startup I try to
    create an instance of my Options class and deserialize the file, but I get a
    SerializationEx ception as follows:

    Engine.LoadOpti ons: System.Runtime. Serialization.S erializationExc eption:
    Cannot find the assembly CodeStore, Version=2.0.0.0 , Culture=neutral ,
    PublicKeyToken= null.
    at
    System.Runtime. Serialization.F ormatters.Binar y.BinaryAssembl yInfo.GetAssemb l
    y()
    at
    System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. GetType(BinaryA s
    semblyInfo assemblyInfo, String name)
    at System.Runtime. Serialization.F ormatters.Binar y.ObjectMap..ct or(String
    objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA , Object[]
    typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader, Int32
    objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
    assemIdToAssemb lyTable)
    at
    System.Runtime. Serialization.F ormatters.Binar y.ObjectMap.Cre ate(String name,
    String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA , Object[]
    typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader, Int32
    objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
    assemIdToAssemb lyTable)
    at
    System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h
    MapTyped(Binary ObjectWithMapTy ped record)
    at
    System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h
    MapTyped(Binary HeaderEnum binaryHeaderEnu m)
    at System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.Run()
    at
    System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. Deserialize(Hea d
    erHandler handler, __BinaryParser serParser, Boolean fCheck,
    IMethodCallMess age methodCallMessa ge)
    at
    System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S
    tream serializationSt ream, HeaderHandler handler, Boolean fCheck,
    IMethodCallMess age methodCallMessa ge)
    at
    System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S
    tream serializationSt ream)
    at Salamander.Addi ns.CodeStore.En gine.Engine.Loa dOptions() in
    c:\development\ codestore\engin e\engine.cs:lin e 78

    Why can't it find the assembly? It is not calling out to a separate library,
    it's a single dll for the add-in and that's where the code is being called
    from. The file it is trying to read is inthe same location as the dll, too.

    The LoadOptions function looks like this:

    internal void LoadOptions()
    {
    try
    {
    string path = GetAddInPath() + this.optionsFil eName;
    Stream stream = new FileStream(path + ".options", FileMode.Open,
    FileAccess.Read , FileShare.Read) ;
    try
    {
    IFormatter formatter = new BinaryFormatter ();
    this.options = (Options)format ter.Deserialize (stream); // <-- This is
    line 78 where the exception is raised.
    }
    catch (System.Excepti on exc)
    {
    System.Diagnost ics.Trace.Write Line(exc.ToStri ng(),
    "Engine.LoadOpt ions");
    }
    finally
    {
    stream.Close();
    }
    }
    catch (System.Excepti on exc)
    {
    if (exc is FileNotFoundExc eption)
    {
    // No options file, so write the current default options to file.
    SaveOptions();
    }
    else
    {
    System.Diagnost ics.Trace.Write Line(exc.Messag e, "Engine.LoadOpt ions");
    }
    }
    }





  • Derek Lakin

    #2
    Re: SerializationEx ception

    Thanks for the idea, but unfortunately I still have the same problem. Any
    other ideas?

    Derek.

    "James X. Li" <donotreplay@ab c.net> wrote in message
    news:%239kfA7WQ DHA.3880@tk2msf tngp13.phx.gbl. ..[color=blue]
    > Try to add the following line into to your add-in assembly:
    >
    > [assembly:AllowP artiallyTrusted Callers]
    >
    >
    >
    > James X. Li
    >
    > "news.microsoft .com" <derek_lakin@li neone.net> wrote in message
    > news:eAec2dWQDH A.2424@tk2msftn gp13.phx.gbl...[color=green]
    > > I have created an add-in for VS.NET and when it starts I want the add-in[/color]
    > to[color=green]
    > > read the options from file.
    > > I have created a class (with the [Serializable] attribute set) that[/color]
    > contains[color=green]
    > > the options and implemented GetObjectData(S erializationInf o info,
    > > StreamingContex t context) as well as a copy constructor: protected
    > > Options(Seriali zationInfo info, StreamingContex t context).
    > >
    > > The serialization process definately works. However, on startup I try to
    > > create an instance of my Options class and deserialize the file, but I[/color][/color]
    get[color=blue]
    > a[color=green]
    > > SerializationEx ception as follows:
    > >
    > > Engine.LoadOpti ons: System.Runtime. Serialization.S erializationExc eption:
    > > Cannot find the assembly CodeStore, Version=2.0.0.0 , Culture=neutral ,
    > > PublicKeyToken= null.
    > > at
    > >[/color]
    >[/color]
    System.Runtime. Serialization.F ormatters.Binar y.BinaryAssembl yInfo.GetAssemb l[color=blue][color=green]
    > > y()
    > > at
    > >[/color]
    >[/color]
    System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. GetType(BinaryA s[color=blue][color=green]
    > > semblyInfo assemblyInfo, String name)
    > > at[/color]
    > System.Runtime. Serialization.F ormatters.Binar y.ObjectMap..ct or(String[color=green]
    > > objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA ,[/color]
    > Object[][color=green]
    > > typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader,[/color][/color]
    Int32[color=blue][color=green]
    > > objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
    > > assemIdToAssemb lyTable)
    > > at
    > > System.Runtime. Serialization.F ormatters.Binar y.ObjectMap.Cre ate(String[/color]
    > name,[color=green]
    > > String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA , Object[]
    > > typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader,[/color][/color]
    Int32[color=blue][color=green]
    > > objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
    > > assemIdToAssemb lyTable)
    > > at
    > >[/color]
    >[/color]
    System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h[color=blue][color=green]
    > > MapTyped(Binary ObjectWithMapTy ped record)
    > > at
    > >[/color]
    >[/color]
    System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h[color=blue][color=green]
    > > MapTyped(Binary HeaderEnum binaryHeaderEnu m)
    > > at[/color][/color]
    System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.Run()[color=blue][color=green]
    > > at
    > >[/color]
    >[/color]
    System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. Deserialize(Hea d[color=blue][color=green]
    > > erHandler handler, __BinaryParser serParser, Boolean fCheck,
    > > IMethodCallMess age methodCallMessa ge)
    > > at
    > >[/color]
    >[/color]
    System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S[color=blue][color=green]
    > > tream serializationSt ream, HeaderHandler handler, Boolean fCheck,
    > > IMethodCallMess age methodCallMessa ge)
    > > at
    > >[/color]
    >[/color]
    System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S[color=blue][color=green]
    > > tream serializationSt ream)
    > > at Salamander.Addi ns.CodeStore.En gine.Engine.Loa dOptions() in
    > > c:\development\ codestore\engin e\engine.cs:lin e 78
    > >
    > > Why can't it find the assembly? It is not calling out to a separate[/color]
    > library,[color=green]
    > > it's a single dll for the add-in and that's where the code is being[/color][/color]
    called[color=blue][color=green]
    > > from. The file it is trying to read is inthe same location as the dll,[/color]
    > too.[color=green]
    > >
    > > The LoadOptions function looks like this:
    > >
    > > internal void LoadOptions()
    > > {
    > > try
    > > {
    > > string path = GetAddInPath() + this.optionsFil eName;
    > > Stream stream = new FileStream(path + ".options", FileMode.Open,
    > > FileAccess.Read , FileShare.Read) ;
    > > try
    > > {
    > > IFormatter formatter = new BinaryFormatter ();
    > > this.options = (Options)format ter.Deserialize (stream); // <-- This[/color][/color]
    is[color=blue][color=green]
    > > line 78 where the exception is raised.
    > > }
    > > catch (System.Excepti on exc)
    > > {
    > > System.Diagnost ics.Trace.Write Line(exc.ToStri ng(),
    > > "Engine.LoadOpt ions");
    > > }
    > > finally
    > > {
    > > stream.Close();
    > > }
    > > }
    > > catch (System.Excepti on exc)
    > > {
    > > if (exc is FileNotFoundExc eption)
    > > {
    > > // No options file, so write the current default options to file.
    > > SaveOptions();
    > > }
    > > else
    > > {
    > > System.Diagnost ics.Trace.Write Line(exc.Messag e,[/color]
    > "Engine.LoadOpt ions");[color=green]
    > > }
    > > }
    > > }
    > >
    > >
    > >
    > >
    > >[/color]
    >
    >[/color]


    Comment

    • Frans Bouma

      #3
      Re: SerializationEx ception

      "news.microsoft .com" <derek_lakin@li neone.net> wrote in
      news:eAec2dWQDH A.2424@tk2msftn gp13.phx.gbl:
      [color=blue]
      > I have created an add-in for VS.NET and when it starts I want the add-in
      > to read the options from file.
      > I have created a class (with the [Serializable] attribute set) that
      > contains the options and implemented GetObjectData(S erializationInf o
      > info, StreamingContex t context) as well as a copy constructor: protected
      > Options(Seriali zationInfo info, StreamingContex t context).
      >
      > The serialization process definately works. However, on startup I try to
      > create an instance of my Options class and deserialize the file, but I
      > get a SerializationEx ception as follows:
      >
      > Engine.LoadOpti ons: System.Runtime. Serialization.S erializationExc eption:
      > Cannot find the assembly CodeStore, Version=2.0.0.0 , Culture=neutral ,
      > PublicKeyToken= null.
      > at
      > System.Runtime. Serialization.F ormatters.Binar y.BinaryAssembl yInfo.GetAss[/color]
      e[color=blue]
      > mbl y()
      > at[/color]

      I had the same problem. It went away when I also implemented
      ISerializable on the objects inside the object that was related to the
      errormessage.

      It's very weird why this error pops up, and you can't debug it,
      because it goes wrong somewhere in the deserialization code of .NET.

      FB


      --
      Solutions Design : http://www.sd.nl
      My open source .NET Software : http://www.sd.nl/software
      My .NET Blog : http://weblogs.asp.net/FBouma
      -------------------------------------------------------------------------

      Comment

      • Dave

        #4
        Re: SerializationEx ception

        This may be too simplistic, but did you derive your class from
        ISerializable? You need to both mark it as Serializable and also as derived
        from ISerializable


        "Derek Lakin" <derek_lakin@li neone.net> wrote in message
        news:%23HyV8DXQ DHA.2212@TK2MSF TNGP12.phx.gbl. ..[color=blue]
        > Thanks for the idea, but unfortunately I still have the same problem. Any
        > other ideas?
        >
        > Derek.
        >
        > "James X. Li" <donotreplay@ab c.net> wrote in message
        > news:%239kfA7WQ DHA.3880@tk2msf tngp13.phx.gbl. ..[color=green]
        > > Try to add the following line into to your add-in assembly:
        > >
        > > [assembly:AllowP artiallyTrusted Callers]
        > >
        > >
        > >
        > > James X. Li
        > >
        > > "news.microsoft .com" <derek_lakin@li neone.net> wrote in message
        > > news:eAec2dWQDH A.2424@tk2msftn gp13.phx.gbl...[color=darkred]
        > > > I have created an add-in for VS.NET and when it starts I want the[/color][/color][/color]
        add-in[color=blue][color=green]
        > > to[color=darkred]
        > > > read the options from file.
        > > > I have created a class (with the [Serializable] attribute set) that[/color]
        > > contains[color=darkred]
        > > > the options and implemented GetObjectData(S erializationInf o info,
        > > > StreamingContex t context) as well as a copy constructor: protected
        > > > Options(Seriali zationInfo info, StreamingContex t context).
        > > >
        > > > The serialization process definately works. However, on startup I try[/color][/color][/color]
        to[color=blue][color=green][color=darkred]
        > > > create an instance of my Options class and deserialize the file, but I[/color][/color]
        > get[color=green]
        > > a[color=darkred]
        > > > SerializationEx ception as follows:
        > > >
        > > > Engine.LoadOpti ons:[/color][/color][/color]
        System.Runtime. Serialization.S erializationExc eption:[color=blue][color=green][color=darkred]
        > > > Cannot find the assembly CodeStore, Version=2.0.0.0 , Culture=neutral ,
        > > > PublicKeyToken= null.
        > > > at
        > > >[/color]
        > >[/color]
        >[/color]
        System.Runtime. Serialization.F ormatters.Binar y.BinaryAssembl yInfo.GetAssemb l[color=blue][color=green][color=darkred]
        > > > y()
        > > > at
        > > >[/color]
        > >[/color]
        >[/color]
        System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. GetType(BinaryA s[color=blue][color=green][color=darkred]
        > > > semblyInfo assemblyInfo, String name)
        > > > at[/color]
        > > System.Runtime. Serialization.F ormatters.Binar y.ObjectMap..ct or(String[color=darkred]
        > > > objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA ,[/color]
        > > Object[][color=darkred]
        > > > typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader,[/color][/color]
        > Int32[color=green][color=darkred]
        > > > objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
        > > > assemIdToAssemb lyTable)
        > > > at
        > > > System.Runtime. Serialization.F ormatters.Binar y.ObjectMap.Cre ate(String[/color]
        > > name,[color=darkred]
        > > > String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA , Object[]
        > > > typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader,[/color][/color]
        > Int32[color=green][color=darkred]
        > > > objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
        > > > assemIdToAssemb lyTable)
        > > > at
        > > >[/color]
        > >[/color]
        >[/color]
        System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h[color=blue][color=green][color=darkred]
        > > > MapTyped(Binary ObjectWithMapTy ped record)
        > > > at
        > > >[/color]
        > >[/color]
        >[/color]
        System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h[color=blue][color=green][color=darkred]
        > > > MapTyped(Binary HeaderEnum binaryHeaderEnu m)
        > > > at[/color][/color]
        > System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.Run()[color=green][color=darkred]
        > > > at
        > > >[/color]
        > >[/color]
        >[/color]
        System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. Deserialize(Hea d[color=blue][color=green][color=darkred]
        > > > erHandler handler, __BinaryParser serParser, Boolean fCheck,
        > > > IMethodCallMess age methodCallMessa ge)
        > > > at
        > > >[/color]
        > >[/color]
        >[/color]
        System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S[color=blue][color=green][color=darkred]
        > > > tream serializationSt ream, HeaderHandler handler, Boolean fCheck,
        > > > IMethodCallMess age methodCallMessa ge)
        > > > at
        > > >[/color]
        > >[/color]
        >[/color]
        System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S[color=blue][color=green][color=darkred]
        > > > tream serializationSt ream)
        > > > at Salamander.Addi ns.CodeStore.En gine.Engine.Loa dOptions() in
        > > > c:\development\ codestore\engin e\engine.cs:lin e 78
        > > >
        > > > Why can't it find the assembly? It is not calling out to a separate[/color]
        > > library,[color=darkred]
        > > > it's a single dll for the add-in and that's where the code is being[/color][/color]
        > called[color=green][color=darkred]
        > > > from. The file it is trying to read is inthe same location as the dll,[/color]
        > > too.[color=darkred]
        > > >
        > > > The LoadOptions function looks like this:
        > > >
        > > > internal void LoadOptions()
        > > > {
        > > > try
        > > > {
        > > > string path = GetAddInPath() + this.optionsFil eName;
        > > > Stream stream = new FileStream(path + ".options", FileMode.Open,
        > > > FileAccess.Read , FileShare.Read) ;
        > > > try
        > > > {
        > > > IFormatter formatter = new BinaryFormatter ();
        > > > this.options = (Options)format ter.Deserialize (stream); // <--[/color][/color][/color]
        This[color=blue]
        > is[color=green][color=darkred]
        > > > line 78 where the exception is raised.
        > > > }
        > > > catch (System.Excepti on exc)
        > > > {
        > > > System.Diagnost ics.Trace.Write Line(exc.ToStri ng(),
        > > > "Engine.LoadOpt ions");
        > > > }
        > > > finally
        > > > {
        > > > stream.Close();
        > > > }
        > > > }
        > > > catch (System.Excepti on exc)
        > > > {
        > > > if (exc is FileNotFoundExc eption)
        > > > {
        > > > // No options file, so write the current default options to file.
        > > > SaveOptions();
        > > > }
        > > > else
        > > > {
        > > > System.Diagnost ics.Trace.Write Line(exc.Messag e,[/color]
        > > "Engine.LoadOpt ions");[color=darkred]
        > > > }
        > > > }
        > > > }
        > > >
        > > >
        > > >
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Derek Lakin

          #5
          Re: SerializationEx ception

          Yes it does derive from ISerializable. Full class listing is:
          using Microsoft.Win32 ;
          using System;
          using System.Runtime. Serialization;

          namespace Salamander.Addi ns.CodeStore.En gine
          {
          /// <summary>
          /// Summary description for Options.
          /// </summary>
          [Serializable]
          internal class Options: ISerializable
          {
          #region Class Data
          internal string ServerUrl =
          "http://www.salamanders oftware.biz/codestore/";
          internal string LocalPath = String.Empty;
          #region Proxy Settings
          internal bool UseProxy = false;
          internal bool BypassProxyOnLo cal = false;
          internal bool ProxyAuthorisat ion = false;
          internal string ProxyAddress = String.Empty;
          internal int ProxyPort = 0;
          internal string ProxyUser = String.Empty;
          internal string ProxyPassword = String.Empty;
          #endregion
          #endregion

          #region Constructors
          /// <summary>
          /// Default Constructor.
          /// </summary>
          internal Options() {}

          /// <summary>
          /// Construct an Options object from serialization.
          /// </summary>
          /// <param name="info"></param>
          /// <param name="context"> </param>
          protected Options(Seriali zationInfo info, StreamingContex t context)
          {
          int version = info.GetInt32(" _OptVersion");

          this.ServerUrl = info.GetString( "ServerUrl" );
          this.LocalPath = info.GetString( "LocalPath" );
          this.UseProxy = info.GetBoolean ("UseProxy") ;
          this.BypassProx yOnLocal = info.GetBoolean ("BypassProxyOn Local");
          this.ProxyAutho risation = info.GetBoolean ("ProxyAuthoris ation");
          this.ProxyAddre ss = info.GetString( "ProxyAddress") ;
          this.ProxyPort = info.GetInt32(" ProxyPort");
          if (version >= 2)
          {
          //TODO: Add encryption support to version 2.
          }
          else
          {
          // Clear text used in version 1.
          this.ProxyUser = info.GetString( "ProxyUser" );
          this.ProxyPassw ord = info.GetString( "ProxyPassword" );
          }
          }
          #endregion

          /// <summary>
          /// Populates a SerializationIn fo with the data needed to serialize the
          target object.
          /// </summary>
          /// <param name="info">The SerializationIn fo to populate with
          data.</param>
          /// <param name="context"> The destination for this serialization.</param>
          public virtual void GetObjectData(S erializationInf o info, StreamingContex t
          context)
          {
          info.AddValue(" _OptVersion", 1);
          info.AddValue(" ServerUrl", this.ServerUrl) ;
          info.AddValue(" LocalPath", this.LocalPath) ;
          info.AddValue(" UseProxy", this.UseProxy);
          info.AddValue(" BypassProxyOnLo cal", this.BypassProx yOnLocal);
          info.AddValue(" ProxyAuthorisat ion", this.ProxyAutho risation);
          info.AddValue(" ProxyAddress", this.ProxyAddre ss);
          info.AddValue(" ProxyPort", this.ProxyPort) ;
          //TODO: Add encryption to version 2.
          info.AddValue(" ProxyUser", this.ProxyUser) ;
          info.AddValue(" ProxyPassword", this.ProxyPassw ord);
          }
          }
          }


          "Dave" <kdlevine@wi.rr .com> wrote in message
          news:eVvFt8XQDH A.1752@TK2MSFTN GP12.phx.gbl...[color=blue]
          > This may be too simplistic, but did you derive your class from
          > ISerializable? You need to both mark it as Serializable and also as[/color]
          derived[color=blue]
          > from ISerializable
          >
          >
          > "Derek Lakin" <derek_lakin@li neone.net> wrote in message
          > news:%23HyV8DXQ DHA.2212@TK2MSF TNGP12.phx.gbl. ..[color=green]
          > > Thanks for the idea, but unfortunately I still have the same problem.[/color][/color]
          Any[color=blue][color=green]
          > > other ideas?
          > >
          > > Derek.
          > >
          > > "James X. Li" <donotreplay@ab c.net> wrote in message
          > > news:%239kfA7WQ DHA.3880@tk2msf tngp13.phx.gbl. ..[color=darkred]
          > > > Try to add the following line into to your add-in assembly:
          > > >
          > > > [assembly:AllowP artiallyTrusted Callers]
          > > >
          > > >
          > > >
          > > > James X. Li
          > > >
          > > > "news.microsoft .com" <derek_lakin@li neone.net> wrote in message
          > > > news:eAec2dWQDH A.2424@tk2msftn gp13.phx.gbl...
          > > > > I have created an add-in for VS.NET and when it starts I want the[/color][/color]
          > add-in[color=green][color=darkred]
          > > > to
          > > > > read the options from file.
          > > > > I have created a class (with the [Serializable] attribute set) that
          > > > contains
          > > > > the options and implemented GetObjectData(S erializationInf o info,
          > > > > StreamingContex t context) as well as a copy constructor: protected
          > > > > Options(Seriali zationInfo info, StreamingContex t context).
          > > > >
          > > > > The serialization process definately works. However, on startup I[/color][/color][/color]
          try[color=blue]
          > to[color=green][color=darkred]
          > > > > create an instance of my Options class and deserialize the file, but[/color][/color][/color]
          I[color=blue][color=green]
          > > get[color=darkred]
          > > > a
          > > > > SerializationEx ception as follows:
          > > > >
          > > > > Engine.LoadOpti ons:[/color][/color]
          > System.Runtime. Serialization.S erializationExc eption:[color=green][color=darkred]
          > > > > Cannot find the assembly CodeStore, Version=2.0.0.0 ,[/color][/color][/color]
          Culture=neutral ,[color=blue][color=green][color=darkred]
          > > > > PublicKeyToken= null.
          > > > > at
          > > > >
          > > >[/color]
          > >[/color]
          >[/color]
          System.Runtime. Serialization.F ormatters.Binar y.BinaryAssembl yInfo.GetAssemb l[color=blue][color=green][color=darkred]
          > > > > y()
          > > > > at
          > > > >
          > > >[/color]
          > >[/color]
          >[/color]
          System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. GetType(BinaryA s[color=blue][color=green][color=darkred]
          > > > > semblyInfo assemblyInfo, String name)
          > > > > at
          > > > System.Runtime. Serialization.F ormatters.Binar y.ObjectMap..ct or(String
          > > > > objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA ,
          > > > Object[]
          > > > > typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader,[/color]
          > > Int32[color=darkred]
          > > > > objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
          > > > > assemIdToAssemb lyTable)
          > > > > at
          > > > >[/color][/color][/color]
          System.Runtime. Serialization.F ormatters.Binar y.ObjectMap.Cre ate(String[color=blue][color=green][color=darkred]
          > > > name,
          > > > > String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA , Object[]
          > > > > typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader,[/color]
          > > Int32[color=darkred]
          > > > > objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
          > > > > assemIdToAssemb lyTable)
          > > > > at
          > > > >
          > > >[/color]
          > >[/color]
          >[/color]
          System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h[color=blue][color=green][color=darkred]
          > > > > MapTyped(Binary ObjectWithMapTy ped record)
          > > > > at
          > > > >
          > > >[/color]
          > >[/color]
          >[/color]
          System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit h[color=blue][color=green][color=darkred]
          > > > > MapTyped(Binary HeaderEnum binaryHeaderEnu m)
          > > > > at[/color]
          > > System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.Run()[color=darkred]
          > > > > at
          > > > >
          > > >[/color]
          > >[/color]
          >[/color]
          System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. Deserialize(Hea d[color=blue][color=green][color=darkred]
          > > > > erHandler handler, __BinaryParser serParser, Boolean fCheck,
          > > > > IMethodCallMess age methodCallMessa ge)
          > > > > at
          > > > >
          > > >[/color]
          > >[/color]
          >[/color]
          System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S[color=blue][color=green][color=darkred]
          > > > > tream serializationSt ream, HeaderHandler handler, Boolean fCheck,
          > > > > IMethodCallMess age methodCallMessa ge)
          > > > > at
          > > > >
          > > >[/color]
          > >[/color]
          >[/color]
          System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( S[color=blue][color=green][color=darkred]
          > > > > tream serializationSt ream)
          > > > > at Salamander.Addi ns.CodeStore.En gine.Engine.Loa dOptions() in
          > > > > c:\development\ codestore\engin e\engine.cs:lin e 78
          > > > >
          > > > > Why can't it find the assembly? It is not calling out to a separate
          > > > library,
          > > > > it's a single dll for the add-in and that's where the code is being[/color]
          > > called[color=darkred]
          > > > > from. The file it is trying to read is inthe same location as the[/color][/color][/color]
          dll,[color=blue][color=green][color=darkred]
          > > > too.
          > > > >
          > > > > The LoadOptions function looks like this:
          > > > >
          > > > > internal void LoadOptions()
          > > > > {
          > > > > try
          > > > > {
          > > > > string path = GetAddInPath() + this.optionsFil eName;
          > > > > Stream stream = new FileStream(path + ".options", FileMode.Open,
          > > > > FileAccess.Read , FileShare.Read) ;
          > > > > try
          > > > > {
          > > > > IFormatter formatter = new BinaryFormatter ();
          > > > > this.options = (Options)format ter.Deserialize (stream); // <--[/color][/color]
          > This[color=green]
          > > is[color=darkred]
          > > > > line 78 where the exception is raised.
          > > > > }
          > > > > catch (System.Excepti on exc)
          > > > > {
          > > > > System.Diagnost ics.Trace.Write Line(exc.ToStri ng(),
          > > > > "Engine.LoadOpt ions");
          > > > > }
          > > > > finally
          > > > > {
          > > > > stream.Close();
          > > > > }
          > > > > }
          > > > > catch (System.Excepti on exc)
          > > > > {
          > > > > if (exc is FileNotFoundExc eption)
          > > > > {
          > > > > // No options file, so write the current default options to[/color][/color][/color]
          file.[color=blue][color=green][color=darkred]
          > > > > SaveOptions();
          > > > > }
          > > > > else
          > > > > {
          > > > > System.Diagnost ics.Trace.Write Line(exc.Messag e,
          > > > "Engine.LoadOpt ions");
          > > > > }
          > > > > }
          > > > > }
          > > > >
          > > > >
          > > > >
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...