Skip to content

Commit 250361f

Browse files
committed
Add UWP workaround to README
1 parent b2a0a1e commit 250361f

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ Detailed Description is [here](./docs/UnitTest.md) to tell you what failed and w
6363
This library is tested on Unity 4.7, 5.2 and 5.3. For AOT environment like iOS, you
6464
need 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.
6565

66+
For windows store build, there is a compatibility issue related with UWP.
67+
If you have a problem, please read [workaround for UWP](./docs/UwpWorkaround.md).
68+
6669
## FAQ
6770

6871
- Q: App stops throwing MissingMethodException for ComponentModel.TypeConverter like this.

docs/UwpWorkaround.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Workaround for UWP (Universal Windows Platform)
2+
3+
Latest windows store uses UWP for building an app.
4+
Unlike regular Unity apps, app for UWP uses dedicated .NET framework which is
5+
not compatible with Unity3D-Mono framework.
6+
7+
## What's the problem?
8+
9+
When you try to build app using Json.NET.Unity3D for Windows Store,
10+
you will get following errors:
11+
12+
```
13+
UnityException: Failed to run serialization weaver with command ...
14+
(stripped)
15+
16+
Mono.Cecil.ResolutionException:
17+
Failed to resolve System.Runtime.Serialization.Formatters.FormatterAssemblyStyle
18+
(stripped)
19+
```
20+
21+
UAP doesn't have enum `FormatterAssemblyStyle` in its assembly and
22+
it should be added to run on windows store.
23+
24+
## How to fix?
25+
26+
It's simple. Use original [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/)
27+
which contains a DLL for UWP.
28+
29+
1. Import [Json.Net.Unity3D](https://github.com/SaladLab/Json.Net.Unity3D/releases/download/8.0.3/JsonNet.8.0.3.unitypackage)
30+
unity package.
31+
1. Create `Assets/UnityPackages/JsonNet/Portable` directory in unity project.
32+
1. Download [Newtonsoft.Json](https://www.nuget.org/api/v2/package/Newtonsoft.Json/8.0.3)
33+
nuget package and extract it as a zip file.
34+
1. Copy `./lib/portable-net45%2Bwp80%2Bwin8%2Bwpa81%2Bdnxcore50/Newtonsoft.Json.dll`
35+
in the nuget package to `Assets/UnityPackages/JsonNet/Portable` directory.
36+
1. Watch `Assets/UnityPackages/JsonNet/Newtonsoft.Json.dll` with an inspector,
37+
uncheck `Any Platform` at Select platforms for plugin
38+
and Set all platforms checked except `WSAPlayer`.
39+
1. Watch `Assets/UnityPackages/JsonNet/Portable/Newtonsoft.Json.dll` with an inspector,
40+
uncheck `Any Platform` at Select platforms for plugin
41+
and set only `WSAPlayer` checked.
42+
43+
Done!

0 commit comments

Comments
 (0)