Skip to content

Copy is not reusing instance #29098

@ajdust

Description

@ajdust

The 'Copy JsonSerializerOptions' section comes right after 'Reuse JsonSerializerOptions instances'. This has been confused as a recommendation to use 'new JsonSerializerOptions(staticInstance)' to reuse JsonSerializerOptions instances. Recommend noting that using this constructor is not the same as a static instance, as the cache of JsonSerializerOptions is not copied to the new one.

dotnet/runtime#30445 (comment)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions