CacheManager icon indicating copy to clipboard operation
CacheManager copied to clipboard

SerializerTypeArguments becomes read only in 1.2.0

Open ziggy90127 opened this issue 1 year ago • 0 comments

I have legacy code using CacheManager.Core 0.9.2 and CacheManager.Serialization.Json 0.9.2, which works fine:

using CacheManager.Core;
using Newtonsoft.Json;
...
var config = ConfigurationBuilder.LoadConfiguration(cacheName);

var serializerSettings = new JsonSerializerSettings
{
	NullValueHandling = NullValueHandling.Ignore,
	ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
	DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate
};

config.SerializerTypeArguments = new object[] { serializerSettings, serializerSettings };

When I upgrade to 1.2.0, SerializerTypeArguments becomes read only. Is this a bug? Is there a workaround? I can't find a simple fix. It seems like I have to copy LoadConfiguration settings into a new BuildConfiguration, and then introduce the serializerSettings there. It's so convoluted though, I have no confidence it's correct. Perhaps it's simple, I just don't know.

ziggy90127 avatar Sep 05 '24 23:09 ziggy90127