From 584ffa36cbc358e94349e0d2f27ba43545bae097 Mon Sep 17 00:00:00 2001 From: leander19961 Date: Wed, 9 Jul 2025 15:25:32 +0200 Subject: [PATCH] Fix crash on Windows (Reflection-based serialization has been disabled for this application) --- LeanderShiftPlannerV2/Service/TimesheetService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LeanderShiftPlannerV2/Service/TimesheetService.cs b/LeanderShiftPlannerV2/Service/TimesheetService.cs index 6281a49..9e5d909 100644 --- a/LeanderShiftPlannerV2/Service/TimesheetService.cs +++ b/LeanderShiftPlannerV2/Service/TimesheetService.cs @@ -128,7 +128,12 @@ public class TimesheetService string jsonResponse = await response.Content.ReadAsStringAsync(); - JsonSerializerOptions options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; + JsonSerializerOptions options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + WriteIndented = true + }; JsonObject? data = JsonSerializer.Deserialize(jsonResponse, options); foreach (KeyValuePair item in data)