neuecc / Utf8Json

Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
MIT License
2.36k stars 267 forks source link

Serializing any struct or class which contains cancelled or failed task is impossible #195

Open RamType0 opened 4 years ago

RamType0 commented 4 years ago

While serializing Task or Task,Utf8Json's builtin task formatter calls Task.Wait() or Task.Result. It causes exception while the task was cancelled or failed.

This means we almost impossible to serialize TaskCancelledException, and any other struct or class which contains cancelled or failed task in their fields.