Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Crashes under .Net 5 #235

Open
IamIC opened this issue Oct 2, 2020 · 2 comments
Open

Crashes under .Net 5 #235

IamIC opened this issue Oct 2, 2020 · 2 comments

Comments

@IamIC
Copy link

IamIC commented Oct 2, 2020

The following throws an exception under .Net 5 / C# 9:

		class Person
		{
			public Person() { }

			public Person(int age, string name, Person[] data)
			{
				Age = age;
				Name = name;
				Data = data;
			}

			public int Age { get; set; }
			public string Name { get; set; }
			public Person[] Data { get; set; }
		}

		private void Test()
		{
			var p = new Person(99, "acrobat", new Person[]
				{
					new Person(1, "abc", null),
					new Person(2, "xyz", null)
				});
			p = new Person(99, "acrobat", new Person[]
				{
					new Person(1, "abc", new Person[] { p }),
					new Person(2, "xyz", null)
				});

			// throws exception
			var result = JsonSerializer.Serialize(p);

			var p2 = JsonSerializer.Deserialize<Person>(result);
		}
@Pete-PlaytimeSolutions
Copy link

Is there any plans to continue development of this project?

@kamyker
Copy link

kamyker commented Jan 13, 2021

try https://github.com/Cryptisk/Utf8Json

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

No branches or pull requests

3 participants