config-parser
config-parser copied to clipboard
add serialization, deserialization of simple objects or collection of objects to Ini format
this.logger.LogDebug($"redis config string: \n {raw.ConfigString}");
var parserConfig = new ConfigParserSettings { MultiLineValues = MultiLineValues.AllowValuelessKeys|MultiLineValues.AllowEmptyTopSection };
var parser = new ConfigParser(raw.ConfigString, parserConfig);
this.logger.LogDebug($"INI FILE CONTENT:{JsonSerializer.Serialize(parser)}");
System.Text.Json.JsonException: A possible object cycle was detected which is not supported. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 0.
at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_SerializerCycleDetected(Int32 maxDepth)
at System.Text.Json.JsonSerializer.Write(Utf8JsonWriter writer, Int32 originalWriterDepth, Int32 flushThreshold, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteCore(Utf8JsonWriter writer, Object value, Type type, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.WriteCore(PooledByteBufferWriter output, Object value, Type type, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.WriteCoreString(Object value, Type type, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Serialize[TValue](TValue value, JsonSerializerOptions options)
Hi, I think that the issue you are having is unrelated to my library. It's a know System.Text.Json' issue
https://github.com/dotnet/runtime/issues/29900
Consider temporarily switching to Newtonsoft.Json In any case let me know if you managed to fix it, I'm always willing to help