XML error when serializing for Windows 10 Universal Store

Hello,

We have successfully released our Unity game on the Google Play Store and now I’m working on getting it in the Windows 10 Universal Store. I’ve succeeded in creating a Windows 10 Visual Studio solution and creating an appx file. When running the app it seems I’m running into the following Unity bug:

Is there a workaround for this bug? I’ve tried another XML serializer but didn’t work. Or do I have to go through the horrible task of loading and saving my XML manually?

Thanks for any help!

Unity: 5.6.0f3
Scripting backend: IL2CPP
.NET version: 4.6

The app throws the following exception:

DllNotFoundException: Unable to load DLL ‘kernel32.dll’: The specified module could not be found.
at Microsoft.Win32.UnsafeNativeMethods.GetModuleHandle (System.String moduleName) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Win32.UnsafeNativeMethods.DoesWin32MethodExist (System.String moduleName, System.String methodName) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Win32.UnsafeNativeMethods._IsPackagedProcess () [0x00000] in <00000000000000000000000000000000>:0
at System.Func1[TResult].Invoke () [0x00000] in <00000000000000000000000000000000>:0 at System.Lazy1[T].CreateValue () [0x00000] in <00000000000000000000000000000000>:0
at System.Lazy1[T].LazyInitValue () [0x00000] in <00000000000000000000000000000000>:0 at System.Lazy1[T].get_Value () [0x00000] in <00000000000000000000000000000000>:0
at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly (System.Type type, System.String defaultNamespace, System.Xml.Serialization.XmlSerializerImplementation& contract) [0x00000] in <00000000000000000000000000000000>:0
at System.Xml.Serialization.XmlSerializer…ctor (System.Type type, System.String defaultNamespace) [0x00000] in <00000000000000000000000000000000>:0
at System.Xml.Serialization.XmlSerializer…ctor (System.Type type) [0x00000] in <00000000000000000000000000000000>:0

This bug only exists with the .NET 4.6 class libraries. If you can switch to .NET 2.0, that should correct the issue.

Unfortunately, that is not an option. Any other ideas?

I don’t think there is another work around. We will simply need to correct the bug from our side then.

Ok. The bug is already reported at Unity Issue Tracker - [WSA] XMLSerializerException thrown when running the IL2CPP build