[WinForms] Removing SerializableAttribute
on Windows Forms classes
#14175
Labels
breaking-change
Indicates a .NET Core breaking change
Remove
SerializableAttribute
from types that don't have known binary serialization scenariosSee SerializableAttribute removed from some Windows Forms types for updated documentation for this change.
A number of Windows Forms classes are no longer decorated with
SerializableAttribute
.Version introduced
3.0 Preview9
Old behavior
Not all types that were
SerializableAttribute
in .NET Framework need to be serializable in .NET Core.New behavior
Removed
SerializableAttribute
from:System.Windows.Forms.NativeMethods.MSOCRINFOSTRUCT
System.Windows.Forms.NativeMethods.MSG
System.InvariantComparer
System.Resources.ResXNullRef
System.Resources.ResXDataNode
System.Resources.ResXFileRef
System.Windows.Forms.Cursor
System.CmmponentModel.Design.ExceptionCollection
System.ComponentModel.Design.Serialization.CodeDomSerializationException
System.ComponentModel.Design.Serialization.CodeDomComponentSerializationService.CodeDomSerializationStore
System.Drawing.Design.ToolboxItem
Reason for change
This serialization mechanism has had serious maintenance and security concerns in the past.
Maintaining
SerializableAttribute
on types means those types need to be tested for Version to Version serialization and potentially framework-to-framework serialization. This makes it harder to evolve those types and can be costly to maintain.More information can be found at https://docs.microsoft.com/en-us/dotnet/standard/serialization/binary-serialization.
Recommended action
Update the code that may have depenedncy on the above types being marked as serializable.
Category
Affected APIs
Not detectable via API analysis
Issue metadata
The text was updated successfully, but these errors were encountered: