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

.NET 9.0 and Binary Formatter being removed #2937

Closed
bwilliams1 opened this issue Mar 7, 2024 · 1 comment
Closed

.NET 9.0 and Binary Formatter being removed #2937

bwilliams1 opened this issue Mar 7, 2024 · 1 comment

Comments

@bwilliams1
Copy link

I currently support a .NET framework 4.8 ASP.NET Web API solution that has a long term goal of migrating to the future versions of .NET such as .NET 9.0. At this time we use Newtonsoft.Json as part of the request/reply deserialization/serialization of API Controllers as native to ASP.NET. We also decided to use Microsoft.AspNet.WebApi.Client (which also depends on Newtonsoft.Json) for deserialization/serialization of request/reply to external API calls that this application depends on. Both of which we plan to take with us as we migrate to .NET 9.0 and beyond.

With the announcement of Binary Formatter being removed from .NET 9, what can we expect from Newtonsoft.Json when running on .NET 9 and beyond? I took a quick glance at the code and there appears to be many instances of the namespace System.Runtime.Serialization.

We've tried to disable the binary formatter related serialization support as best we can, even though Microsoft.AspNet.WebApi.Client makes it a little more difficult by only allowing us to do this by specifying a list of custom MediaTypeFormatters when using ReadAsAsync and disabling it (IgnoreSerializableAttribute = true) in those formatters. A global setting to disable for all use cases would be ideal. (Perhaps a feature request for that repo, but figured I'd start here)

@JamesNK
Copy link
Owner

JamesNK commented Mar 7, 2024

System.Runtime.Serialization and BinaryFormatter are different. Using attributes of APIs from that name space doesn't mean BinaryFormatter is used.

There is no impact on Newtonsoft.Json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants