You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.12.0
.NET version
SDK version 9.0.100
Did this work in a previous version of Visual Studio and/or previous .NET release?
I think this issue applies since BinaryFormatter was marked Obsolete.
Edit: I'm actually not sure if the designer ever could serialize PointF values out of the box.
Issue description
When a control with PointF property is used through the WinForms designer, the following warning is generated:
Form1.resx : warning MSB3825: Resource "userControl11.Point" of type "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" may be deserialized via BinaryFormatter at runtime. BinaryFormatter is deprecated due to known security risks and is removed from .NET 9+. If you wish to continue using it, set property "GenerateResourceWarnOnBinaryFormatterUse" to false.
Form1.resx : warning MSB3825: More information: https://aka.ms/binaryformatter-migration-guide
I have found related issues #9701 and #9110, but it is still not clear to me how to work around this issue. I don't think suppressing the warning as suggested is acceptable. The control could be in a third party DLL, so modifying the control is not a workable solution either.
Note that the property is grayed out in the designer, so it is unclear why it is serialized in the first place.
Thank you for your report! The WinForms designer has historically always used BinaryFormatter in ResX serialization/deserialization scenarios at design time if the following are true: https://learn.microsoft.com/dotnet/standard/serialization/binaryformatter-migration-guide/winforms-applications#the-windows-forms-designer. msbuild is generating this warning because it sees a binary serialized object in Form1.resx as it is generating a .resources file. Since resources are considered trusted data, at runtime these resources will deserialize as expected without BinaryFormatter so the warning can be suppressed. If you are experiencing issues with being unable to deserialize resources at runtime please let us know, we'd be happy to investigate.
Environment
Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.12.0
.NET version
SDK version 9.0.100
Did this work in a previous version of Visual Studio and/or previous .NET release?
I think this issue applies since BinaryFormatter was marked Obsolete.
Edit: I'm actually not sure if the designer ever could serialize PointF values out of the box.
Issue description
When a control with PointF property is used through the WinForms designer, the following warning is generated:
I have found related issues #9701 and #9110, but it is still not clear to me how to work around this issue. I don't think suppressing the warning as suggested is acceptable. The control could be in a third party DLL, so modifying the control is not a workable solution either.
Note that the property is grayed out in the designer, so it is unclear why it is serialized in the first place.
Steps to reproduce
Build the following repro: WinFormsApp1.zip
The text was updated successfully, but these errors were encountered: