Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add serialization, deserialization of simple objects or collection of objects to Ini format #4

Open
salaros opened this issue Jul 18, 2015 · 2 comments
Assignees

Comments

@salaros
Copy link
Owner

salaros commented Jul 18, 2015

No description provided.

@salaros salaros self-assigned this Jun 24, 2018
@naughtyGitCat
Copy link

naughtyGitCat commented Mar 5, 2020

                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)

@salaros
Copy link
Owner Author

salaros commented Mar 8, 2020

Hi, I think that the issue you are having is unrelated to my library. It's a know System.Text.Json' issue

dotnet/runtime#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants