[release/8.0.1xx] Remove CA2229 Implement serialization constructors #6915
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #6911 to release/8.0.1xx
/cc @buyaa-n
Customer Impact
Hidden rule CA2229:
Implement serialization constructors
, can be enabled specifically by ID or can be enabled as part of bulk configuration. Starting in .NET 8 SYSLIB0051:Legacy serialization support APIs are obsolete
generates warning at compile time for theserialization constructors
(and also for other BF related APIs) therefore conflicts with CA2229.As Binary formatters are deprecated in .NET Core
CA2229
is also out dated and can be removed.Testing
NA, removing the analyzer entirely
Risk
Very low:
NetAnalyzers
manually. If they still need the analyzer, they could keep using the older versions.For both cases even if they missed adding the constructor a basic app testing would uncover such a bug, so it is less risky.