Binary Deserialization Fails when using new version of Win Spread

Posted by: allenk on 23 June 2021, 11:43 am EST

    • Post Options:
    • Link

    Posted 23 June 2021, 11:43 am EST

    I have been using the Binary Save function as outlined in this and other sites.

    I was using Version 13 of Farpoint Spread for windows (ver 13.45.20191.0). I installed an update (ver 13.45.20203.0) and can’t open the files that are serialized in the older version when I reference the newer Spread control.

    How can I deserialize and use an object that was serialized, using binary formatter, in previous version using the newer version of the spread control?

  • Posted 24 June 2021, 3:27 am EST

    Hi,

    I’m assuming that you currently have both versions of Spread assemblies installed in GAC and you’re getting InvalidCastException:

    System.InvalidCastException: '[A]FarPoint.Win.Spread.SheetView cannot be cast to [B]FarPoint.Win.Spread.SheetView.

    If this is the case, then you will need to add assembly binding redirects (https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions) in your App.config file so that only the latest assembly is used.

    You can add following in the runtime section of your App.config file:

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="FarPoint.Win" publicKeyToken="327c3516b1b18457"/>
            <bindingRedirect oldVersion="1.0.1.0-13.45.20191.4" newVersion="13.45.20203.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="FarPoint.Win.Chart" publicKeyToken="327c3516b1b18457"/>
            <bindingRedirect oldVersion="1.0.1.0-13.45.20191.4" newVersion="13.45.20203.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="FarPoint.Win.Spread" publicKeyToken="327c3516b1b18457"/>
            <bindingRedirect oldVersion="1.0.1.0-13.45.20191.4" newVersion="13.45.20203.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="GrapeCity.Spreadsheet" publicKeyToken="327c3516b1b18457"/>
            <bindingRedirect oldVersion="1.0.1.0-13.45.20191.4" newVersion="13.45.20203.0"/>
          </dependentAssembly>
        </assemblyBinding>
    

    If you were referring to any other error, then please mention the error and the steps to reproduce the error.

    Regards,

    Jitender

  • Posted 24 June 2021, 1:15 pm EST

    Yes. Thank you.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels