From 1d0f6e3b6704c7a383f98b5a88c475150125922d Mon Sep 17 00:00:00 2001 From: Chris Bell Date: Sun, 17 Nov 2024 20:53:23 -0600 Subject: [PATCH] Fix json serialization error --- Tiles/Tile.cs | 4 +++- Tiles/Tiles.csproj | 24 +++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Tiles/Tile.cs b/Tiles/Tile.cs index a436340..2000d87 100644 --- a/Tiles/Tile.cs +++ b/Tiles/Tile.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using System.Text.Json.Serialization.Metadata; using Newtonsoft.Json; using Raylib_cs; using JsonSerializer = System.Text.Json.JsonSerializer; @@ -15,7 +16,8 @@ public class Tile private static JsonSerializerOptions _jsonSerializerOptions = new() { - WriteIndented = true + WriteIndented = true, + TypeInfoResolver = new DefaultJsonTypeInfoResolver() }; public static Tile GenerateTileFromJson(string jsonPath) diff --git a/Tiles/Tiles.csproj b/Tiles/Tiles.csproj index 3971e1d..8d34196 100644 --- a/Tiles/Tiles.csproj +++ b/Tiles/Tiles.csproj @@ -1,23 +1,21 @@  - Exe net8.0 enable enable + true + $(PublishFileExclusionsFromSatelliteAssemblies);data/**/*.* - - - - - - - - - - - + + - + + + + + + + \ No newline at end of file