From e12042b38ebd6c8372fef63743ad28954ca186f1 Mon Sep 17 00:00:00 2001 From: database64128 Date: Tue, 11 May 2021 23:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=8D=EF=B8=8F=20Json=20serialization:=20ig?= =?UTF-8?q?nore=20read-only=20properties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change was made to ignore properties inherited from `ReactiveObject`, which has annotations that opt out of serialization for public properties. But System.Text.Json doesn't support these annotations (ref dotnet/runtime#29975). --- YoutubeDl.Wpf/Utils/FileHelper.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/YoutubeDl.Wpf/Utils/FileHelper.cs b/YoutubeDl.Wpf/Utils/FileHelper.cs index 93c3623f4..c11f542e0 100644 --- a/YoutubeDl.Wpf/Utils/FileHelper.cs +++ b/YoutubeDl.Wpf/Utils/FileHelper.cs @@ -12,6 +12,7 @@ public static class FileHelper public static readonly JsonSerializerOptions commonJsonSerializerOptions = new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + IgnoreReadOnlyProperties = true, WriteIndented = true, };