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

Epic- Update BinaryFormatter usage #6267

Open
7 of 10 tasks
merriemcgaw opened this issue Dec 4, 2021 · 14 comments
Open
7 of 10 tasks

Epic- Update BinaryFormatter usage #6267

merriemcgaw opened this issue Dec 4, 2021 · 14 comments
Assignees
Labels
area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization Epic Groups multiple user stories. Can be grouped under a theme. Priority:1 Work that is critical for the release, but we could probably ship without
Milestone

Comments

@merriemcgaw merriemcgaw added api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation Epic Groups multiple user stories. Can be grouped under a theme. labels Dec 4, 2021
@merriemcgaw merriemcgaw added this to the .NET 7.0 milestone Dec 4, 2021
@merriemcgaw merriemcgaw changed the title Remove BinaryFormatter from WinForms runtime Epic Remove BinaryFormatter from WinForms runtime Dec 4, 2021
@merriemcgaw merriemcgaw changed the title Epic Remove BinaryFormatter from WinForms runtime Epic- Remove BinaryFormatter from WinForms runtime Dec 4, 2021
@weltkante
Copy link
Contributor

weltkante commented Dec 6, 2021

whats the replacement for BinaryFormatter in clipboard/drag'n'drop data exchange? anything been announced yet?

[edit] found it myself, #6269, sorry for the noise, will follow that issue as it evolves.

@RussKie
Copy link
Member

RussKie commented Dec 8, 2021

At this stage we don't have any formed plans or announcements. Binary formatters are used in multiple scenarios - e.g. the clipboard and resources. We are fully aware this deprecation will likely have far reaching impact, and we need to plan accordingly.

@merriemcgaw merriemcgaw added the Priority:2 Work that is important, but not critical for the release label Jan 19, 2022
@merriemcgaw merriemcgaw modified the milestones: .NET 7.0, .NET 8.0 Aug 10, 2022
@merriemcgaw merriemcgaw changed the title Epic- Remove BinaryFormatter from WinForms runtime Epic- Update BinaryFormatter usage Feb 22, 2023
@merriemcgaw
Copy link
Member Author

@JeremyKuhne Is there anything you think should be included in this epic that I haven't already added?

@JeremyKuhne JeremyKuhne added the area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization label May 1, 2023
@merriemcgaw merriemcgaw modified the milestones: .NET 8.0, 8.0 Preview5 May 10, 2023
@merriemcgaw
Copy link
Member Author

@JeremyKuhne some of these things may go away entirely with your new PRs. I want to capture your work here for Preview 5 and break out a .NET 9 follow up set of items to track separately.

@MagicAndre1981
Copy link

why is this only Prio 2 if BinaryFormatter gets removed in .NET9? I think this should be critical issue for .net 9 milestone @merriemcgaw

@merriemcgaw
Copy link
Member Author

@MagicAndre1981 It was pri 2 for the .NET 8 release 😄 , thanks for pointing that out - I'll adjust now!

@merriemcgaw merriemcgaw added Priority:1 Work that is critical for the release, but we could probably ship without and removed Priority:2 Work that is important, but not critical for the release labels Feb 23, 2024
@lonitra lonitra pinned this issue Mar 6, 2024
@kirsan31
Copy link
Contributor

kirsan31 commented Mar 18, 2024

After build our apps with .Net8 we see such warnings for autogenerated typed datasets (actually typed DataTables):
image

DS.Designer.cs: warning SYSLIB0051: 'DataSet.DataSet(SerializationInfo, StreamingContext, bool)' is obsolete: 'This API supports obsolete formatter-based serialization. It should not be called or extended by application code.' (https://aka.ms/dotnet-warnings/SYSLIB0051)

DS.Designer.cs: warning SYSLIB0051: 'TypedTableBase<DS.SniperRow>.TypedTableBase(SerializationInfo, StreamingContext)' is obsolete: 'This API supports obsolete formatter-based serialization. It should not be called or extended by application code.' (https://aka.ms/dotnet-warnings/SYSLIB0051)

What will happen with all of this in .Net9? We have some of these legacy typed datasets generated by designer 😳 Also time to time we use designer to edit generated datasets.

  • What will be with already generated datasets - will them cotinine to work?
  • If on first point answer is yes, then will we can to edit them with visual designer (edit existing tables and create new one)?
    image

@kirsan31
Copy link
Contributor

/cc @merriemcgaw @JeremyKuhne

@JeremyKuhne
Copy link
Member

@KlausLoeffelmann this is something we'll want to investigate.

@kirsan31 at worst, you'll have to reference a new NuGet package to get this to work. We're working on making sure embedded resources just work (as they're considered trusted). I'm not sure what the BinaryFormatter workflow is for data sets, but we'll look to make sure we're fully clear how it might be impacted.

@KlausLoeffelmann
Copy link
Member

Yes, this is definitely something we need to test intensively.

@MagicAndre1981
Copy link

MagicAndre1981 commented Jul 11, 2024

What is the current state now that BinaryFormatter was removed from runtime and moved to System.Runtime.Serialization.Formatters nuget?

Do you use this nuget now for Winforms if you can't removed BF until deadline for .net9? What impact will this have to WinForm Devs? Do we also need to enable it in the csproj of the winforms project?

<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>

@JeremyKuhne
Copy link
Member

Marking as 10 for remaining work.

@MagicAndre1981
Copy link

@JeremyKuhne and what happens in .NET9? Will the nuget be referenced automatically when UseWinForms is set in csproj?

@JeremyKuhne
Copy link
Member

@MagicAndre1981 the package will not be referenced automatically. Anything that could be moved away from the BinaryFormatter has been. Remaining (.NET 10) work is to improve diagnostics for guidance when you're potentially hitting BinaryFormatter paths and adding of new API to reduce risk when you're using the BinaryFormatter with custom types on the clipboard and with drag/drop.

More detailed guidance documents are being finalized and will be posted soon. @lonitra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization Epic Groups multiple user stories. Can be grouped under a theme. Priority:1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

No branches or pull requests

10 participants