{"id":13663831,"url":"https://github.com/SaladLab/Json.Net.Unity3D","last_synced_at":"2025-04-25T18:31:19.082Z","repository":{"id":42950176,"uuid":"46217413","full_name":"SaladLab/Json.Net.Unity3D","owner":"SaladLab","description":"Forked Newtonsoft.Json to support Unity3D","archived":false,"fork":false,"pushed_at":"2019-12-07T08:14:55.000Z","size":8459,"stargazers_count":920,"open_issues_count":23,"forks_count":168,"subscribers_count":64,"default_branch":"master","last_synced_at":"2025-04-09T21:49:48.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SaladLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-15T12:52:46.000Z","updated_at":"2025-04-06T16:20:05.000Z","dependencies_parsed_at":"2022-09-22T04:23:19.788Z","dependency_job_id":null,"html_url":"https://github.com/SaladLab/Json.Net.Unity3D","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaladLab%2FJson.Net.Unity3D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaladLab%2FJson.Net.Unity3D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaladLab%2FJson.Net.Unity3D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaladLab%2FJson.Net.Unity3D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaladLab","download_url":"https://codeload.github.com/SaladLab/Json.Net.Unity3D/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250872042,"owners_count":21500757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T05:02:38.274Z","updated_at":"2025-04-25T18:31:19.065Z","avatar_url":"https://github.com/SaladLab.png","language":"C#","readme":"[![Build status](https://ci.appveyor.com/api/projects/status/slry7u0dy894pevo/branch/master?svg=true)](https://ci.appveyor.com/project/veblush/json-net-unity3d/branch/master)\n\n# Newtonsoft Json.NET for Unity3D\n\n[Newtonsoft Json.NET](http://www.newtonsoft.com/json) is a de facto standard JSON library in .NET ecosystem.\nBut it doesn't support Unity3D, so it's a little bit hard to use JSON.NET just after getting [Json.NET package](https://www.nuget.org/packages/Newtonsoft.Json/).\nThis package is for Unity3D programmers that need to use latest Json.NET in Unity3D.\n\n## Where can I get it?\n\nVisit [Release](https://github.com/SaladLab/Json.Net.Unity3D/releases)\npage to get latest Json.NET unity-package.\n\nTo use this library in IL2CPP build settings, you need to add\n[link.xml](https://github.com/SaladLab/Json.Net.Unity3D/blob/master/src/UnityPackage/Assets/link.xml) to your project's asset folder.\nFor detailed information about link.xml, read unity [manual](http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html) about this.\n\n## What's the deal?\n\nUnity3D has old-fashioned and bizarre .NET Framework like these :)\n - Basically based on .NET Framework 3.5 ([forked Mono 2.6](https://github.com/Unity-Technologies/mono/commits/unity-staging))\n - Runtime lacks some types in .NET Framework 3.5 (like System.ComponentModel.AddingNewEventHandler)\n - For iOS, dynamic code emission is forbidden by Apple AppStore.\n\nBecause Newtonsoft Json.NET doesn't handle these limitations, errors will welcome you\nwhen you use official Json.NET dll targetting .NET 3.5 Framework.\n\n## What's done?\n\nFollowing works are done to make Json.NET support Unity3D.\n\n - Based on Newtonsoft Json.NET 9.\n - Disable IL generation to work well under AOT environment like iOS.\n - Remove code related with System.ComponentModel.\n - Remove System.Data and EntityKey support.\n - Remove XML support.\n - Remove DiagnosticsTraceWriter support.\n - Workaround for differences between Microsoft.NET \u0026 Unity3D-Mono.NET\n\nFor Unity.Lite version, additional works are done to make more lite.\n\n - Remove JsonLinq, JPath (JToken, ...)\n - Remove Bson\n\n## Unit Test\n\nTests in Json.NET are updated to be able to run under\n[UnityEditor Test Runner](http://docs.unity3d.com/Manual/testing-editortestsrunner.html).\nAll tests pass under Microsoft .NET 3.5 but with UnityEditor some of them fail\nbecause there are not-implemented features and bugs in Unity3D-Mono framework.\n\nTest Result:\n\n| Profile        |:white_check_mark: Passed | :x: Failed | :white_circle: Ignored |\n| :------------- | -----------------------: | ---------: | ---------------------: |\n| Microsoft.NET  |                     1605 |          0 |                      1 |\n| Unity3D-Mono   |                     1592 |         13 |                      1 |\n\nDetailed Description is [here](./docs/UnitTest.md) to tell you what failed and why.\n\n## Unity Compatibility\n\nThis library is tested on Unity 4.7, 5.2 and 5.3. For AOT environment like iOS, you\nneed to use IL2CPP instead of obsolute Mono-AOT because IL2CPP handles generic code better than Mono-AOT. With Mono-AOT configuration, AOT related exception would be thrown.\n\nFor windows store build, there is a compatibility issue related with UWP.\nIf you have a problem, please read [workaround for UWP](./docs/UwpWorkaround.md).\n\n## FAQ\n\n#### Q: `MissingMethodException` is thrown for `ComponentModel.TypeConverter`.\n\n```csharp\nMissingMethodException: Method not found:\nDefault constructor not found...ctor() of System.ComponentModel.TypeConverter.\n```\n\nMake sure that `link.xml` is added to your project.\n\n#### Q: `ExecutionEngineException` is thrown in calling `CreateValueInternal`.\n\n```csharp\nxecutionEngineException:\n  Attempting to call method 'CLASS::.cctor' for which no ahead of time (AOT) code was generated.\nat System.Reflection.MonoCMethod.Invoke (...)\nat Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal\n```\n\nThis exception is thrown because Unity3D strips out unnecessary classes which are actually used by serialization.\nTo fix this problem, just put `new CLASS()` in your code to prevent Unity3D from removing the class.\n\nReference: [TroubleShootingIPhone](https://docs.unity3d.com/Manual/TroubleShootingIPhone.html)\n\n#### Q: `ArgumentNullException` is thrown in calling `CreateParameterizedConstructor`.\n\n```csharp\nArgumentNullException: Argument cannot be null.\nParameter name: method\nat Newtonsoft.Json.Utilities.ValidationUtils.ArgumentNotNull (...)\nat Newtonsoft.Json.Utilities.LateBoundReflectionDelegateFactory.CreateParameterizedConstructor (...)\n```\n\nThis is similar with the previous case. But this case is tricky because this is\ncaused by Json.NET internal classes such as `CollectionWrapper\u003cT\u003e`.\nTo fix this problem, put `AotHelper.EnsureList\u003cT\u003e()` if you use `HashSet\u003cT\u003e`\nor `AotHelper.EnsureDictionary\u003cTKey, TValue\u003e()` if you use `Dictionary\u003cTKey, TValue\u003e` in working class.\n","funding_links":[],"categories":["C\\#","Serializer and Deserializer","Engines","Serializers"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaladLab%2FJson.Net.Unity3D","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSaladLab%2FJson.Net.Unity3D","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaladLab%2FJson.Net.Unity3D/lists"}