Repository navigation
Remove Serialization Guard public APIs - #38739
Conversation
- Also refactors reflection helpers into separate file
|
Hello @GrabYourPitchforks! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
|
||
| private static Type GetDeserializationBlockedExceptionType() | ||
| { | ||
| return typeof(SerializationInfo).Assembly.GetType("System.Runtime.Serialization.DeserializationBlockedException", throwOnError: false); |
There was a problem hiding this comment.
Can we just use a regular SerializationException for this, and get rid of the DeserializationBlockedException completely?
There was a problem hiding this comment.
That would change the control flow of some callers. For example, ObjectManager special-cases the DeserializationBlockedException type and rethrows it rather than allowing a typical TargetInvocationException to escape.
In order to preserve this runtime behavior, would it make sense for us to leave DeserializationBlockedException in (but not exposed via contracts), but have it subclass SerializationException instead of the base Exception type?
There was a problem hiding this comment.
Why is this runtime behavior important? There are number of other places that will wrap the exception.
There was a problem hiding this comment.
(Correction to my above comment: it seems DeserializationBlockedException already subclasses SerializationException in the implementation. The ref assembly incorrectly shows it as subclassing Exception directly.)
I wouldn't call the existing behavior "important" per se, but I was trying to avoid behavioral changes in this PR. If consensus is that reusing SerializationException directly is the preferred action, and if the behavioral change isn't concerning, we can absolutely piggy-back that on this PR.
|
With the latest iteration I've removed all references to |
* Remove Serialization Guard public APIs - Also refactors reflection helpers into separate file * PR feedback - remove DeserializationBlockedException refs entirely
* Remove Serialization Guard public APIs - Also refactors reflection helpers into separate file * PR feedback - remove DeserializationBlockedException refs entirely Commit migrated from dotnet/corefx@8b73a6d
Removes public APIs per https://github.com/dotnet/corefx/issues/36723 and our conversations over email. Also refactors the reflection-based code out of the
Processclass and into its own standalone file so that it can be shared by future components if needed.There are no behavioral changes from this PR.