-
Notifications
You must be signed in to change notification settings - Fork 88
Replace BinaryFormatter with DataContractSerializer #641
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
base: master
Are you sure you want to change the base?
Conversation
BinaryFormatter is deprecated in future .NET versions and may prevent assemblies from unloading or return incorrect results. Replaced with System.Runtime.Serialization.DataContractSerializer as recommended for compatibility. Changes: - KdTree.cs: Replaced BinaryFormatter with DataContractSerializer in SaveToFile and LoadFromFile methods - KdTreeNode.cs: Added DataContract and DataMember attributes - Added [DataContract] and [DataMember] attributes to all serialized classes Related to SCP-1555
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## master #641 +/- ##
=======================================
Coverage 35.57% 35.57%
=======================================
Files 277 277
Lines 34897 34897
=======================================
Hits 12416 12416
Misses 22481 22481
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Marking this ready for review just for the purpose of triggering the automatic PR CI jobs (to get a gauge for how these changes fare)! Hope that's OK :) |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent |
PR Code Suggestions ✨Explore these optional code suggestions:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent |
|||||||||
Overview
This PR replaces all instances of
BinaryFormatterwithSystem.Runtime.Serialization.DataContractSerializerin this repo, and is part of Epic SCP-1555.Previous Behavior
The package used deprecated BinaryFormatter which is deprecated in future .NET versions and may prevent assemblies from unloading or return incorrect results.
New & Expected Behavior
The package now uses DataContractSerializer for serialization/deserialization with [DataContract] and [DataMember] attributes added to all serialized classes.
Changes
Further Context
JIRA-ticket
Testing
Running the default job-suite. Please share if there are additional steps needed!