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

Eliminate BinaryFormatter #1354

Closed
Tracked by #1629
CharliePoole opened this issue Jul 30, 2023 · 1 comment · Fixed by #1647
Closed
Tracked by #1629

Eliminate BinaryFormatter #1354

CharliePoole opened this issue Jul 30, 2023 · 1 comment · Fixed by #1647
Labels
Milestone

Comments

@CharliePoole
Copy link
Member

It's considered unsafe and is going away. See https://github.com/dotnet/designs/blob/main/accepted/2020/better-obsoletion/binaryformatter-obsoletion.md.

I've started work on this for my own engine (TestCentric/testcentric-engine#127) and I expect that the changes would apply almost directly to NUnit as well, possibly modified to allow for any changes made in that area since I left.

@CharliePoole CharliePoole self-assigned this Jun 5, 2024
@CharliePoole CharliePoole added V4 All issues related to V4 - use -label:V4 to get non-V4 issues Feature labels Jun 5, 2024
@CharliePoole CharliePoole added this to the 4.0 milestone Sep 30, 2024
@CharliePoole CharliePoole removed the V4 All issues related to V4 - use -label:V4 to get non-V4 issues label Dec 14, 2024
@CharliePoole CharliePoole modified the milestones: 4.0, 4.0.0-beta.1 Dec 29, 2024
@CharliePoole CharliePoole changed the title Time to get rid of BinaryFormatter? Eliminate BinaryFormatter Jan 2, 2025
@CharliePoole CharliePoole removed their assignment Jan 26, 2025
@CharliePoole CharliePoole added the V4 All issues related to V4 - use -label:V4 to get non-V4 issues label Feb 1, 2025
@CharliePoole
Copy link
Member Author

CharliePoole commented Mar 13, 2025

I'm moving this to the 3.20 release, at least temporarily. If I'm able to get the work done in time, it will be released with 3.20 and then ported to V4.

Whether in V3 or V4, I plan to do this in two stages using separate PRs.

1. Simplify the structure of Messages

I currently maintain three versions of our BinarySerializationProtocol, all of which use BinaryForatter. There are two NUnit versions for V3 and V4 and a TestCentric version, which has evolved to use a more simple Message structure, represented by a single C# class. NUnit uses four classes. Moving to a single class with different message types recognized by the content of the message rather than it's .NET Type, is an improvement and will make elimination of BinaryFormatter a bit simpler.

2. Eliminate use of BinaryFormatter

Once the first stage is complete, it becomes possible to treat all messages simply as arrays of bytes and I believe we can eliminate any further encoding or decoding of the content.

@CharliePoole CharliePoole removed the V4 All issues related to V4 - use -label:V4 to get non-V4 issues label Mar 13, 2025
@CharliePoole CharliePoole modified the milestones: 4.0.0-beta.1, 3.20.0 Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant