Latest windows store uses UWP for building an app. Unlike regular Unity apps, app for UWP uses dedicated .NET framework which is not compatible with Unity3D-Mono framework.
When you try to build app using Json.NET.Unity3D for Windows Store, you will get following errors:
UnityException: Failed to run serialization weaver with command ...
(stripped)
Mono.Cecil.ResolutionException:
Failed to resolve System.Runtime.Serialization.Formatters.FormatterAssemblyStyle
(stripped)
UAP doesn't have enum FormatterAssemblyStyle
in its assembly and
it should be added to run on windows store.
It's simple. Use original Newtonsoft.Json which contains a DLL for UWP.
- Import Json.Net.Unity3D unity package.
- Create
Assets/UnityPackages/JsonNet/Portable
directory in unity project. - Download Newtonsoft.Json nuget package and extract it as a zip file.
- Copy
./lib/portable-net45%2Bwp80%2Bwin8%2Bwpa81%2Bdnxcore50/Newtonsoft.Json.dll
in the nuget package toAssets/UnityPackages/JsonNet/Portable
directory. - Watch
Assets/UnityPackages/JsonNet/Newtonsoft.Json.dll
with an inspector, uncheckAny Platform
at Select platforms for plugin and Set all platforms checked exceptWSAPlayer
. - Watch
Assets/UnityPackages/JsonNet/Portable/Newtonsoft.Json.dll
with an inspector, uncheckAny Platform
at Select platforms for plugin and set onlyWSAPlayer
checked.
If you feel complicated, just download
this and extract it to Assets/UnityPackages/JsonNet
directory in your project.