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

.NET 10 Preview 1 - WinForms Release Notes #9722

Draft
wants to merge 6 commits into
base: dotnet10p1
Choose a base branch
from

Conversation

merriemcgaw
Copy link
Member

Here is the first draft of our release notes for Preview 1.

First draft of release nites
I did use AI to translate to markdown from docx formats.
Copy link
Member

@lonitra lonitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should double check that new Clipboard/DataObject APIs documentation is on the learn.microsoft site for preview so users may be able to more quickly understand the APIs

release-notes/10.0/preview/preview1/winforms.md Outdated Show resolved Hide resolved
release-notes/10.0/preview/preview1/winforms.md Outdated Show resolved Hide resolved
release-notes/10.0/preview/preview1/winforms.md Outdated Show resolved Hide resolved
@merriemcgaw merriemcgaw marked this pull request as draft February 6, 2025 00:30
Applying the latest feedback and correcting a couple mistakes.

- `public void SetDataAsJson<T>(T data)`
- `public void SetDataAsJson<T>(string format, T data)`
- `public void SetDataAsJson<T>(string format, bool autoConvert, T data)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • public void SetDataAsJson<T>(T data)
  • public void SetDataAsJson<T>(string format, T data)
  • public void SetDataAsJson<T>(string format, bool autoConvert, T data)
  • protected virtual bool TryGetDataCore<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data)
    These are not interface methods, they are added on the concrete DataObject class

Suggestions:
DataObject:

  • public void SetDataAsJson<T>(T data)
  • public void SetDataAsJson<T>(string format, T data)
  • public void SetDataAsJson<T>(string format, bool autoConvert, T data)
  • public bool TryGetData<T>(out T data);
  • public bool TryGetData<T>(string format, out T data);
  • public bool TryGetData<T>(string format, bool autoConvert, out T data);
  • public bool TryGetData<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data);
  • protected virtual bool TryGetDataCore<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data)

ITypedDataObject:

  • public bool TryGetData<T>(out T data);
  • public bool TryGetData<T>(string format, out T data);
  • public bool TryGetData<T>(string format, bool autoConvert, out T data);
  • public bool TryGetData<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data);


### New Configuration Switch

If an application is unable to adopt the new APIs, and requires a fallback to `BinaryFormatter` serialization during Clipboard and Drag/Drop operations, the developer will need to take additional action. In .NET 9, calls to BinaryFormatter will always throw a `PlatformNotSupportedException` unless the developer follows the instructions located here: [BinaryFormatter compatibility package](https://learn.microsoft.com/dotnet/standard/serialization/binaryformatter-migration-guide/compatibility-package) . In .NET 10 Preview 1, WinForms will now also by default disable the use of BinaryFormatter as a fallback unless it is explicitly enabled with this new configuration switch. This switch is `Windows.ClipboardDragDrop.EnableUnsafeBinaryFormatterSerialization`, and it must be set to `True` for the fallback to happen successfully.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: extra white space after the closing paren.

Copy link
Member

@Tanya-Solyanik Tanya-Solyanik Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In .NET 10 Preview 1, WinForms will now also by default disable ... ->> In .NET 10 Preview 1, WinForms will also by default disable the use of BinaryFormatter on the application level using the same compatibility switches. Additionally, we allow developer to control BinaryFormatter usage in Clipboard only with a new compatibility switch Windows.ClipboardDragDrop.EnableUnsafeBinaryFormatterSerialization. For full compatibility application should reference the OOB package and opt in into 2 compat switches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants