Deserialization constructors#21025
Merged
gewarren merged 2 commits intodotnet:masterfrom Oct 12, 2020
Merged
Conversation
tdykstra
approved these changes
Oct 10, 2020
...nges/serialization/5.0/non-public-parameterless-constructors-not-used-for-deserialization.md
Outdated
Show resolved
Hide resolved
…ss-constructors-not-used-for-deserialization.md Co-authored-by: Tom Dykstra <tdykstra@microsoft.com>
ahsonkhan
reviewed
Oct 12, 2020
|
|
||
| #### Change description | ||
|
|
||
| On .NET Core 3.0 and 3.1, internal and private constructors can be used for deserialization. On .NET Standard 2.0 and 2.1, internal and private constructors are not allowed, and a <xref:System.MissingMethodException> is thrown if no public, parameterless constructor is defined. |
Contributor
There was a problem hiding this comment.
Netstandard isn't really a TFM, so it would be better to rephrase this to say something like: the standalone NuGet packages versions 4.6.0-4.7.2 that support netstandard 2.0 (and higher) behaved inconsistently with the built-in behavior on .NET Core 3.1/3.1 ... (add the details). Starting with .NET 5.0/NuGet package 5.0.0 (and higher), the behavior is consistent (and then describe the details of the consistent behavior).
https://www.nuget.org/packages/System.Text.Json/
- .NET Core 3.0 release has STJ built-in and we also shipped a 4.6.0 standalone STJ NuGet package that supports ns2.0 to support older platform.
- .NET Core 3.1 release along with 4.7.0 STJ NuGet package (which continues to support ns2.0).
- .NET core 3.0/3.1 built-in API behavior was inconsistent with the 4.6.0/4.7.0 standalone NuGet package.
- .NET Core 5.0 release along with 5.0.0 STJ NuGet package (which continues to support ns2.0).
- Now, both the built-in APIs and the standalone package for older platforms behave the same.
Contributor
ahsonkhan
reviewed
Oct 12, 2020
...nges/serialization/5.0/non-public-parameterless-constructors-not-used-for-deserialization.md
Show resolved
Hide resolved
ahsonkhan
reviewed
Oct 12, 2020
...nges/serialization/5.0/non-public-parameterless-constructors-not-used-for-deserialization.md
Show resolved
Hide resolved
ahsonkhan
reviewed
Oct 12, 2020
...nges/serialization/5.0/non-public-parameterless-constructors-not-used-for-deserialization.md
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #20887.
Preview link.