runtime icon indicating copy to clipboard operation
runtime copied to clipboard

System.Text.Json ExpandoObject not supported

Open MikeReznikov opened this issue 7 years ago • 2 comments

When i try to return ExpandoObject as a return, looks like its not supported yet

` ExpandoObject e = new ExpandoObject(); ((IDictionary<string, object>)e).Add("key", "value");

        var results = System.Text.Json.JsonSerializer.Serialize(e);`

Unable to cast object of type '<GetExpandoEnumerator>d__51' to type 'System.Collections.IDictionaryEnumerator'.

planned for version 3?

MikeReznikov avatar Sep 17 '19 13:09 MikeReznikov

planned for version 3?

No. We do not have support for dynamic types like ExpandoObject and is a known limitation for what's shipping in 3.0. This is a duplicate of https://github.com/dotnet/corefx/issues/38007

Feel free to add your scenario/use case to that issue to help motivate it.

ahsonkhan avatar Sep 18 '19 00:09 ahsonkhan

This is a problem with .net core 3.0 version, you only need to upgrade the version to 3.1.

Uranus-s avatar Feb 11 '20 06:02 Uranus-s