Binary formatter depricated

Posted by: peter.herschel on 14 March 2024, 3:10 am EST

    • Post Options:
    • Link

    Posted 14 March 2024, 3:10 am 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 14 March 2024, 7:49 pm EST - Updated 14 March 2024, 7:58 pm 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

Need extra support?

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

Learn More

Forum Channels