Fix json serialization error

This commit is contained in:
Chris Bell 2024-11-17 20:53:23 -06:00
parent d9124434bb
commit 1d0f6e3b67
2 changed files with 14 additions and 14 deletions

View File

@ -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)

View File

@ -1,23 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishSingleFile>true</PublishSingleFile>
<PublishFileExclusionsFromSatelliteAssemblies>$(PublishFileExclusionsFromSatelliteAssemblies);data/**/*.*</PublishFileExclusionsFromSatelliteAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Raylib-cs" Version="6.1.1" />
</ItemGroup>
<ItemGroup>
<Content Include="data/**/*.*" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Folder Include="data\core\" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Raylib-cs" Version="6.1.1" />
</ItemGroup>
</Project>
<ItemGroup>
<Content Include="data/**/*.*" CopyToOutputDirectory="Always" /> </ItemGroup>
<ItemGroup>
<Folder Include="data\core\" />
</ItemGroup>
</Project>