![]() |
VOOZH | about |
dotnet add package Json.Net --version 1.0.33
NuGet\Install-Package Json.Net -Version 1.0.33
<PackageReference Include="Json.Net" Version="1.0.33" />
<PackageVersion Include="Json.Net" Version="1.0.33" />Directory.Packages.props
<PackageReference Include="Json.Net" />Project file
paket add Json.Net --version 1.0.33
#r "nuget: Json.Net, 1.0.33"
#:package Json.Net@1.0.33
#addin nuget:?package=Json.Net&version=1.0.33Install as a Cake Addin
#tool nuget:?package=Json.Net&version=1.0.33Install as a Cake Tool
A minimalistic JSON handler library.
Json.Net (.NET Standard 2.0) : https://www.nuget.org/packages/Json.Net/
Json.Net.Core (.NET 5.0) : https://www.nuget.org/packages/Json.Net.Core/
Define a POCO class...
class Pet
{
public int id;
public string name;
}
Serialization...
var petJson = JsonNet.Serialize(pet);
Deserialization...
var pet = JsonNet.Deserialize<Pet>(petJson);
You can also define and use custom type converters to control serialization/deserialization.
var dateConverter =
new JsonConverter<DateTime>(
dt => dt.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss", CultureInfo.InvariantCulture),
s => DateTime.ParseExact(s, "yyyy'-'MM'-'dd'T'HH':'mm':'ss", CultureInfo.InvariantCulture));
var petJson = JsonNet.Serialize(pet, dateConverter);
using Json.Net;
string JsonNet.Serialize(object obj, params IJsonConverter[] converters)
Serializes an object to its JSON text representation.
obj : Object to be serialized
converters : Custom type converters. Default: empty
void Serialize(object obj, Stream stream, params IJsonConverter[] converters)
Serializes an object to a JSON text stream destination.
obj : Object to be serialized
stream : JSON stream
converters : Custom type converters. Default: empty
void Serialize(object obj, TextWriter writer, params IJsonConverter[] converters)
Serializes an object to a JSON text writer destination.
obj : Object to be serialized
writer : JSON text writer
converters : Custom type converters. Default: empty
T JsonNet.Deserialize<T>(string json, params IJsonConverter[] converters)
Deserializes an object from a JSON text.
T : Deserialized object's type
json : JSON text
converters : Custom converters. Default: empty
T Deserialize<T>(Stream stream, params IJsonConverter[] converters)
Deserializes an object from a JSON text stream source.
T : Deserialized object's type
stream : JSON stream
converters : Custom converters. Default: empty
T Deserialize<T>(TextReader reader, params IJsonConverter[] converters)
Deserializes an object from a JSON text reader source.
T : Deserialized object's type
reader : JSON text reader
converters : Custom converters. Default: empty
public interface IJsonConverter
{
Type GetConvertingType();
string Serializer(object obj);
object Deserializer(string txt);
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Json.Net:
| Package | Downloads |
|---|---|
|
Cryptocurrency.Blockchain
Cryptocurrency.Blockchain is a library for interacting with the Blockchain Data API provided by Blockchain. |
|
|
CrunchyrollAPI
Description |
|
|
Griffin.ReportWriter
Griffin Report Writer (C# Custom Library, for internal use only) |
|
|
Tyle_Evmos
Package Description |
|
|
Tyle.Nft
Package Description |
Showing the top 5 popular GitHub repositories that depend on Json.Net:
| Repository | Stars |
|---|---|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
|
|
VRCWizard/TTS-Voice-Wizard
Speech to Text to Speech. Song now playing. Sends text as OSC messages to VRChat to display on avatar. (STTTS) (Speech to TTS) (VRC STT System) (VTuber TTS)
|
|
| stuff-by-3-random-dudes/UWUVCI-AIO-WPF | |
|
AzureAD/SCIMReferenceCode
Reference code to build a SCIM endpoint to automate provisioning
|
|
|
R2NorthstarTools/VTOL
A Manager and Installer For the Titanfall 2 +Northstar launcher.
|
- Guid conversion bugfix
- IEnumerable deserialization bugfix
- ExpandoObjects implemented
- String to Expando conversion bugfix
- IEnumerable<> deserialization bugfix
- Nullable Enum deserialization bugfix
- Interface null deserialization bugfix