Binary formatter depricated

Posted by: peter.herschel on 14 March 2024, 12:10 pm EST

    • Post Options:
    • Link

    Posted 14 March 2024, 12:10 pm EST

    I’ve been using spread v16 with a win forms net 8 project. When I place the spread control on an empty form and compile, I get a message about resource1 is using a deprecated method:

    resource “resource1” of type “System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=…” is deserialized via BinaryFormatter at runtime. BinaryFormatter is deprecated

    Everything works fine. Checking my code base, I’ve noticed this message appearing on other existing forms now that I upgraded my projects from net 7.

    Should I just upgrade to a new version of spread - v17 ? If so, is there any information on converting my current code?

    Thanks

    -Pete

  • Posted 15 March 2024, 4:49 am EST - Updated 15 March 2024, 4:58 am EST

    Hi Peter,

    Spread.NET v16 is not supported for .NET8. Since Spread.NET v17 is compatible with .NET8, we suggest you update to version 17 of the control. For this, you can simply update the referred DLLs or update your v16 package to v17 via NuGet as shown in the following GIF:

    Link to download latest Spread.NET installer: https://developer.mescius.com/spreadnet/download

    There might be some minor code changes required specific to your implementation, based on the updates in the API. For release updates, please check the following link: https://developer.mescius.com/spreadnet/docs/latest/readme/rnotesSpWin.html

    Since BinaryFormatter is deprecated in .NET8 and will be removed with .NET9, we suggest you disable GenerateResourceWarnOnBinaryFormatterUse property in the csproj file(or vsproj file) of your project as shown below:

    
    <PropertyGroup>
      <!-- [Already existing code] -->
     <GenerateResourceWarnOnBinaryFormatterUse>false</GenerateResourceWarnOnBinaryFormatterUse>
    </PropertyGroup>
    
    

    Kindly refer to the attached GIF to see the steps:

    Hope this helps you.

    Thanks & Regards,

    Aastha

  • Posted 19 November 2024, 10:08 am EST

    My visual studio updated to support NET9. I did a test project and added the 17.2 spread to a form.

    I added a reference to the nuget package System.Runtime.Serialization.Formatters

    and added the option: EnableUnsafeBinaryFormatterSerialization equals true to the project’s property group

    This will get the form to work. However the spread designer throws an expection if you try view it while designing.

    I suppose we will have to wait for the next version of the control?

    Thanks

  • Posted 20 November 2024, 8:00 am EST

    Hi Peter,

    Spread.NET v17.2.0 does not support .NET9 officially. It supports .NET9 from V18.

    However, could you please share the project that throws the exception. This might help us find some useful information to know if a workaround is possible for v17.2.0.

    Thanks & Regards,

    Aastha

  • Posted 20 November 2024, 9:03 am EST

    CheckApp.zip

    This is the simple project I experimented with. It only has one form with a ref to 17.2

  • Posted 21 November 2024, 8:44 am EST

    Hi Peter,

    Thanks for the sample application.

    This issue is caused due to an exception thrown by an internal logic. The developers have informed us that it has been fixed in v18 but unfortunately, there is no workaround solution for v17. [Internal Tracking ID: SPNET-44293]

    We kindly request you wait for the v18 release, which is expected to be publicly available in December, 2024.

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels