-
Notifications
You must be signed in to change notification settings - Fork 5k
6.0 - System.Text.Json.JsonSerializer.Deserialize System.Net.DnsEndPoint System.NotSupportedException #48205
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
Comments
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsDescriptionSystem.Text.Json.JsonSerializer.Deserialize for System.Net.DnsEndPoint results in: "Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported. Type 'System.Net.DnsEndPoint'..." Configuration
Regression?I don't believe so: #29895 Other informationI thought I read it was supposed to work in 5.0, but I was already using that.
|
I believe the standard approach for serializing a class you don't own is to define a |
That's a great feature. I just made use of it and like it. https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to?pivots=dotnet-5-0 |
Later in .NET 6.0 when we expose the internal serialization metadata classes as part of the JSON code gen work - #34456 - users will be able to specify the deserialization constructor to use for any type (including non-owned types), without |
Description
System.Text.Json.JsonSerializer.Deserialize for System.Net.DnsEndPoint results in: "Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported. Type 'System.Net.DnsEndPoint'..."
Configuration
Regression?
I don't believe so: #29895
Other information
I thought I read it was supposed to work in 5.0, but I was already using that.
When I saw it was marked as "Done" for 6.0 (#29895 (comment)), I installed that, but it's still an issue.
It at least serialized the object:
The text was updated successfully, but these errors were encountered: