MikValSor.SerializableValidator 1.0.2

.NET Standard 2.0 .NET Framework 4.5
There is a newer version of this package available.
See the version list below for details.
dotnet add package MikValSor.SerializableValidator --version 1.0.2
NuGet\Install-Package MikValSor.SerializableValidator -Version 1.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="MikValSor.SerializableValidator" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MikValSor.SerializableValidator --version 1.0.2
#r "nuget: MikValSor.SerializableValidator, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MikValSor.SerializableValidator as a Cake Addin
#addin nuget:?package=MikValSor.SerializableValidator&version=1.0.2

// Install MikValSor.SerializableValidator as a Cake Tool
#tool nuget:?package=MikValSor.SerializableValidator&version=1.0.2

Library for validating that .NET classes are serializable and deserialize with System.Runtime.Serialization.


class MyClass
	public string Value;

class MyOtherClass : System.Runtime.Serialization.ISerializable
	public string Value;

	public MyOtherClass()

	private MyOtherClass(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		Value = (string)info.GetValue("Value", typeof(string));

	void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		info.AddValue("Value", Value, typeof(string));

void Validate()
	var validator = new MikValSor.Runtime.Serialization.SerializableValidator();

	var myObject = new MyClass();
	bool isMyObjectImmutable = validator.IsSerializable(myObject);
	System.Console.WriteLine($"Is myObject serializable: {isMyObjectImmutable}");

	var myOtherObject = new MyOtherClass();
	bool isMyOtherObjectImmutable = validator.IsSerializable(myOtherObject);
	System.Console.WriteLine($"Is myOtherObject serializable: {isMyOtherObjectImmutable}");
	Is myObject serializable: False
	Is myOtherObject serializable: True
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MikValSor.SerializableValidator:

Package Downloads

Package Description


Library for storage of immutable .Net types.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 4,320 5/22/2018
1.0.3 721 5/22/2018
1.0.2 833 4/30/2018
1.0.1 796 4/30/2018
1.0.0 797 4/30/2018

- Added support for structs

- Changed target to not allow null.

- Initial release.