GDSerializer 2.0.3

dotnet add package GDSerializer --version 2.0.3
NuGet\Install-Package GDSerializer -Version 2.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GDSerializer" Version="2.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GDSerializer --version 2.0.3
#r "nuget: GDSerializer, 2.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GDSerializer as a Cake Addin
#addin nuget:?package=GDSerializer&version=2.0.3

// Install GDSerializer as a Cake Tool
#tool nuget:?package=GDSerializer&version=2.0.3

GDSerializer

GDSerializer is an XML serialization (and deserialization) library developed with Godot's C# API in mind.

It supports (de)serialization of almost any C# type including collections and managed types, and provides an interface to create custom (de)serializers that can then be used by the default implementation to further increase its capabilities.

Installation

GDSerializer is available as a NuGet package, which can be installed either through an IDE or by manually including the following lines in a Godot project's .csproj file:

<ItemGroup>
    <PackageReference Include="GDSerializer" Version="2.0.3"/>
</ItemGroup>

Its dependencies may need to be installed as well, in a similar fashion.

Due to a bug in Godot, the following lines will also need to be included in the .csproj file to properly compile along with NuGet packages:

<PropertyGroup>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

Note that GDSerializer targets .NET Standard 2.1 whereas Godot projects target .NET Framework 4.7.2 by default, so the target framework may need to be changed either through an IDE or by manually editing the .csproj file like so:

<TargetFramework>netstandard2.1</TargetFramework>

It is also recommended to enable nullability warnings in the project; however, this is completely optional. Again, this can be done either through an IDE or by including the following lines in the .csproj file:

<PropertyGroup>
    <Nullable>enable</Nullable>
</PropertyGroup>

Usage

Creating a new serializer instance:

Serializer serializer = new(); // or new Serializer() for older language versions that do not recognise target-typed new()

Serializing an object as an XML node:

XmlNode xml = serializer.Serialize(obj);

Deserializing an XML node as an object:

object? obj = serializer.Deserialize(xml);

An optional type argument can be provided for both serialization and deserialization, in order to assist the serializer with figuring out the object's Type.
Generic versions of the methods can also be used.

More detailed instructions on using the Serializer class can be found on the GDSerializer wiki.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on GDSerializer:

Package Downloads
Modot

A mod loader and API for applications made using Godot, with the ability to load C# assemblies, XML data, and resource packs at runtime.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on GDSerializer:

Repository Stars
Carnagion/Modot
A mod loader and API for applications made using Godot, with the ability to load C# assemblies, XML data, and resource packs at runtime.
Version Downloads Last updated
2.0.3 1,135 8/10/2022
2.0.2 351 8/7/2022
2.0.1 358 8/7/2022
2.0.0 373 8/7/2022
1.1.0 834 6/25/2022
1.0.0 589 6/10/2022
0.2.0 367 5/18/2022
0.1.2 347 5/16/2022
0.1.1 368 5/14/2022
0.1.0 361 5/12/2022