Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 8 - 9
BSD 3-Clause "New" or "Revised" License
408 stars 62 forks source link

[Bug]: BinaryFormatter is deprecated due to possible security risks and will be removed with .NET 9. #1138

Closed Smurf-IV closed 5 months ago

Smurf-IV commented 1 year ago

Severity Code Description Project File Line Warning (active) MSB3825 Resource "_imageList.ImageStream" of type "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" is deserialized via BinaryFormatter at runtime. BinaryFormatter is deprecated due to possible security risks and will be removed with .NET 9. If you wish to continue using it, set property "GenerateResourceWarnOnBinaryFormatterUse" to false. More information: https://aka.ms/msbuild/net8-binaryformatter Krypton.Toolkit 2022 (net8.0-windows), Krypton.Toolkit 2022 (net9.0-windows) Z:\GitHub\Krypton-Suite\Standard-Toolkit\Source\Krypton Components\Krypton.Toolkit\Designers\UX\KryptonContextMenuCollectionForm.resx 1

or :

Severity    Code    Description Project File    Line
Warning (active)    MSB3825 Resource "_imageList.ImageStream" of type "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" is deserialized via BinaryFormatter at runtime. BinaryFormatter is deprecated due to possible security risks and will be removed with .NET 9. If you wish to continue using it, set property "GenerateResourceWarnOnBinaryFormatterUse" to false.
           More information: https://aka.ms/msbuild/net8-binaryformatter    Krypton.Toolkit 2022 (net8.0-windows), Krypton.Toolkit 2022 (net9.0-windows)    Z:\GitHub\Krypton-Suite\Standard-Toolkit\Source\Krypton Components\Krypton.Toolkit\Designers\UX\KryptonContextMenuCollectionForm.resx   1
PWagner1 commented 1 year ago

Would this also affect the planned theme binary import feature?

AngeloCresta commented 1 year ago

the issue is opened also in the dotnet/winforms git https://github.com/dotnet/winforms/issues/9701#issuecomment-1803290602

AngeloCresta commented 11 months ago

If you need to run the code in .net9 without changing the sources you can add this on the Toolkit project files `

true true $(NoWarn);SYSLIB0011 false

` Angelo

Smurf-IV commented 5 months ago

Remove the errant resx file, and then checked that the designer still works: image