-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support for JsonSerializer.Context when StreamingContext is removed #2953
Comments
EDIT: Oh, never mind, my apologies. Ignore my comment please, i didn't notice you're a Microsoft guy...
|
Thanks @elgonzo , I think your opinion is valid, as I expected this too as a way to mark this issue as by design, if we believe we won't be blocked by it in the future. |
I also get warnings in .NET 8 for code like: jsonSerializerSettings.Context =
new StreamingContext(
StreamingContextStates.All,
optionsDict); Warnings are:
Will this code break in .NET 9? |
Since the
StreamingContext
type is Obsolete in .NET 8, is there a future plan for supporting a serialization context in the future?StreamingContext was used in the
BinaryFormatter
infrastructure, which is going away, although Newtonsoft.Json uses this type for non-BinaryFormatter purposes.The current workaround is to suppress the warning when using the JsonSerializer.Context property (when newing up
StreamingContext
actually), but it's not ideal.If I read the BinaryFormatter obsoletion roadmap correctly, the type will not be removed in future versions (hopefully), so it might not be completely blocking given the workaround, but it's still worth some consideration.
The text was updated successfully, but these errors were encountered: