C#


ROSLYN.PERFORMANCE.CA1869 : Cache and reuse 'JsonSerializerOptions' instances (C#)

See Roslyn-Detected C# Warning Classes for more information.

Summary

Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead. Single use 'JsonSerializerOptions' instances can substantially degrade the performance of your application.

This check corresponds to Roslyn rule CA1869. For full rule details, see the Microsoft website: CA1869.

Properties

Class Name Cache and reuse 'JsonSerializerOptions' instances (C#)
Significance reliability
Mnemonic ROSLYN.PERFORMANCE.CA1869
Categories None
Availability Available for C# only.
Enabling Checks for this warning class are enabled by default. To disable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Cache and reuse 'JsonSerializerOptions' instances (C#)"

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.