SharpSerializer 4.0.2

dotnet add package SharpSerializer --version 4.0.2
NuGet\Install-Package SharpSerializer -Version 4.0.2
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="SharpSerializer" Version="4.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpSerializer --version 4.0.2
#r "nuget: SharpSerializer, 4.0.2"
#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 SharpSerializer as a Cake Addin
#addin nuget:?package=SharpSerializer&version=4.0.2

// Install SharpSerializer as a Cake Tool
#tool nuget:?package=SharpSerializer&version=4.0.2

SharpSerializer 4.x

SharpSerializer is an open source XML and binary serializer for .NET. With only one line of code it can serialize types like: multidimensional array, nested array, array-of-arrays, polymorphic object (where value is inherited from the property type), generic type, generic listing (i.e. dictionary, collection) and many more...

Project URL: https://github.com/polenter/SharpSerializer

License URL: https://github.com/polenter/SharpSerializer/blob/master/LICENSE.txt

Prerequisites

Runtime

SharpSerializer requires .NET Framework 4.6.2 or a .NET platform implementing .NET Standard 2.0.

Below link contains a list with supported .NET implementations:
.NET Standard 2.0

Installation

From NuGet

Using NuGet is recommended.

In Visual Studio open NuGet Package Manager and type-in: Install-Package Polenter.SharpSerializer

In the Command Line (.NET CLI) use the dotnet command:

dotnet add package SharpSerializer

From a standalone file

The following libraries should be attached to your deployment package:

  • Polenter.SharpSerializer.dll

Usage

var obj = CreateMyVerySophisticatedObject();
var serializer = new SharpSerializer();
serializer.Serialize(obj, "test.xml");
var obj2 = serializer.Deserialize("test.xml");

There are more usage examples on the tutorial page:
http://sharpserializer.com/en/tutorial/

Usage Limitations

SharpSerializer serializes only public properties. If you like to serialize fields or private properties, they have to be wrapped in public properties.

SharpSerializer can deserialize only types providing public or private default constructor.

Please refer to the following article for a workaround:
https://www.codeproject.com/Articles/240621/How-to-serialize-data-effectively-Custom-serializa

Breaking Changes

3.x → 4.x

Abandoned support for netstandard1.0, netstandard1.3, netcoreapp3.1 and net452.

Using .NET 8 in demo projects and in unit tests.

2.x → 3.x

All platforms below .NET Framework 4.5 are no more supported.

Support for Portable Class Library (PCL) was depreciated. The following file is no more deployed:

  • Polenter.SharpSerializer.Portable.dll

There are no breaking changes in the API in .NET Framework 4.5.2 and above.

There are no breaking changes in the API expected, if using PCL, however it's not thoroughly tested yet.

The BSD License (BSD) was changed to MIT License

Deployment

NuGet

cd ./SharpSerializer
dotnet build -c Release
dotnet pack -c Release
dotnet nuget push .\bin\Release\SharpSerializer.4.0.2.nupkg -k <your-nuget-api-key>

Contributing

There are some tests concerning deploying and using SharpSerializer on different platforms, e.g. .NET Framework 4.5.2, .NET Core 1.0, 2.0 and Xamarin.
More tests on different platforms are however appreciated.

Additional contributors are welcome. Just change source code, create unit tests and request a pull.

Authors

Pawel Idzikowski, polenter (owner)

License

This project is licensed under the MIT License - see LICENSE.txt file for details.

The following copyright notice should be attached to your software (e.g. about box):

This software includes SharpSerializer - Copyright (c) 2010 Pawel Idzikowski
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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (16)

Showing the top 5 NuGet packages that depend on SharpSerializer:

Package Downloads
Envoc.Core.Audit.EF

Envoc.Core.Audit.EF

S4S

S4S is a SDK that will allow you to create custom controls for your application enabling accessibility on them. This includes resizing the controls and their fontsize or enabling scroll helpers to remove the swipe motion.

EventWay.EventStore.AzureAppendBlob

Package Description

EventWay.MessageSerializer.SharpSerializer

Package Description

DS.SimpleServiceBus

Add message-based communication to your application easily using message brokers.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on SharpSerializer:

Repository Stars
pwntester/ysoserial.net
Deserialization payload generator for a variety of .NET formatters
FDlucifer/Proxy-Attackchain
Proxylogon & Proxyshell & Proxyoracle & Proxytoken & All exchange server history vulns summarization :)
vchelaru/FlatRedBall
Cross-platform 2D game engine focused on ultimate productivity built in .NET
Version Downloads Last updated
4.0.2 619 3/24/2024
3.0.2 88,577 12/28/2021
3.0.1 872,313 10/8/2017
2.20.0 244,022 3/21/2014
2.18.0 64,368 1/29/2012
2.16.0 31,627 11/9/2011
2.15.0 2,613 10/25/2011
2.14.0 2,546 10/23/2011
2.13.1 2,564 8/19/2011
2.13.0 3,077 8/6/2011
2.12.0 2,620 7/31/2011
2.11.0 2,634 7/28/2011
2.10.0 2,688 6/19/2011
2.9.0 13,032 5/9/2011

Support for .NET Standard 2.0 and .NET Framework 4.6.2.