Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WinForms] Removing SerializableAttribute on Windows Forms classes #14175

Closed
RussKie opened this issue Sep 3, 2019 · 1 comment
Closed

[WinForms] Removing SerializableAttribute on Windows Forms classes #14175

RussKie opened this issue Sep 3, 2019 · 1 comment
Labels
breaking-change Indicates a .NET Core breaking change

Comments

@RussKie
Copy link
Member

RussKie commented Sep 3, 2019

Remove SerializableAttribute from types that don't have known binary serialization scenarios

See 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:

  1. System.Windows.Forms.NativeMethods.MSOCRINFOSTRUCT
  2. System.Windows.Forms.NativeMethods.MSG
  3. System.InvariantComparer
  4. System.Resources.ResXNullRef
  5. System.Resources.ResXDataNode
  6. System.Resources.ResXFileRef
  7. System.Windows.Forms.Cursor
  8. System.CmmponentModel.Design.ExceptionCollection
  9. System.ComponentModel.Design.Serialization.CodeDomSerializationException
  10. System.ComponentModel.Design.Serialization.CodeDomComponentSerializationService.CodeDomSerializationStore
  11. 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

  • Windows Forms

Affected APIs

Not detectable via API analysis


Issue metadata

  • Issue type: breaking-change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change
Projects
None yet
Development

No branches or pull requests

3 participants