Search Issue Tracker

Fixed in 2018.3



Found in


Issue ID




[WSA] XMLSerializerException thrown when running the IL2CPP build

Steps to reproduce:
1. Open the attached project (
2. Open the Assets/Game.unity scene
3. Switch platform to Windows Store
4. Build for WSA Universal 10 SDK (IL2CPP backend), Build type - XAML
5. Open Visual Studio solution
6. Deploy on local machine (Debug or Release)
7. Observe the errors in the Output console

Expected result: Errors should not appear in the Output console
Actual result: Errors appear in the Output console

Not reproducible with Master mode

Reproduced with: 5.6.0b10, 5.6.0b11, 2017.1.0a2
Not reproduced with: 5.4.5f1, 5.5.2p2

Fixed in: 2018.3.0a11 (on .NET Standard 2.0 Api Compatibility Level)

Comments (14)

  1. 6ca7782e240804d0e9125b211b22bf83?d=mm


    May 14, 2019 07:48

    Apparently this Bug still exists in Unity 2018.3.14 ... still the only thing working is switching to compatibility level ".Net Standard 2.0" ... exception is thrown for

    var serializer = new XmlSerializer(typeof(SomeType));


    System.ArgumentException: 'CP1252' is not supported encoding name.

  2. 03c5c8d4d35707deec820f38872683e7?d=mm


    May 14, 2019 07:45

    This issue appears to persist in Unity 2018.3.14

  3. Bd236ddb418d5b65aaa18efa0eaf1215?d=mm


    Mar 25, 2019 15:37

    Still had this issue in 2018.3.4f1 with Api Compatibility Level .Net 4.x
    Switching to .Net Standard 2.0 (still throws an exception but) worked for me.

  4. 4d636c2c1f464ea51a9faf9c417154f3?d=mm


    Oct 29, 2018 15:40

    Seems to be still open for 2018.3.0b6 with .NET 4.6 enabled. I think this should not only be fixed for a specific framework, but for all available frameworks. Could you please reopen this issue so that we can cast votes again?

  5. 6cf884289b30bf5f6adaf9a54ff0361e?d=mm


    Sep 13, 2018 20:53

    I see that 2018.3b was released for beta. However, this issue is not mentioned in the release notes. Is this fixed?

  6. De2a1e57672f86438dbae1a0c307ad45?d=mm


    Aug 06, 2018 15:02

    So which version of Unity is this fixed for IL2CPP?

  7. 6cf884289b30bf5f6adaf9a54ff0361e?d=mm


    Jul 26, 2018 23:52

    Just upgraded to 2018.2.1f1. I confirmed that the System.XML.Serialization issue is fixed under 2018.2.1f1 under the ".NET Standard 2.0" selection in the "API Compatibility Level" setting.

  8. 6cf884289b30bf5f6adaf9a54ff0361e?d=mm


    Jul 26, 2018 22:20

    @joshpeterson - I am currently using 2018.1. Is there a release date for the 2018.3 beta? I am also using System.Xml.Serialization and have the same output as @cruelbob. I am unable to run on iOS and release to my testers because of this error.

  9. B1dfd1c8a2662016a5818a9f27432c47?d=mm


    Jul 04, 2018 13:06

    Caught this error on Unity 2018.1.6f1 using .Net Standard 2.0:
    NotSupportedException: /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection.Emit/AssemblyBuilder.cpp(20) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported.
    System.Reflection.Emit.AssemblyBuilder..ctor (System.Reflection.AssemblyName n, System.String directory, System.Reflection.Emit.AssemblyBuilderAccess access, System.Boolean corlib_internal) (at <00000000000000000000000000000000>:0)
    System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access, System.String dir, System.Security.Policy.Evidence evidence, System.Security.PermissionSet requiredPermissions, System.Security.PermissionSet optionalPermissions, System.Security.PermissionSet refusedPermissions, System.Boolean isSynchronized) (at <00000000000000000000000000000000>:0)
    System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access) (at <00000000000000000000000000000000>:0)
    System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly (System.Xml.Serialization.XmlMapping[] xmlMappings, System.Type[] types, System.String defaultNamespace, System.Security.Policy.Evidence evidence) (at <00000000000000000000000000000000>:0)
    System.Xml.Serialization.TempAssembly..ctor (System.Xml.Serialization.XmlMapping[] xmlMappings, System.Type[] types, System.String defaultNamespace, System.String location, System.Security.Policy.Evidence evidence) (at <00000000000000000000000000000000>:0)
    System.Xml.Serialization.XmlSerializer.GenerateTempAssembly (System.Xml.Serialization.XmlMapping xmlMapping, System.Type type, System.String defaultNamespace) (at <00000000000000000000000000000000>:0)
    System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.String defaultNamespace) (at <00000000000000000000000000000000>:0)

  10. 8b1a42e8bcbf816696f60a10cfa3b940?d=mm


    Jun 06, 2018 11:56

    The problem here is managed code in System.Xml.dll that does not place nicely with an AOT compiler (like IL2CPP).

    We've corrected this issue in 2018.1 and 2018.2. In those versions of Unity, you will need to use the .Net Standard 2.0 Api Compatibility Level to get the AOT-friendly version of System.Xml.dll. In Unity 2018.3 we will also have an AOT-friendly version of System.Xml.dll for the .NET 4.x Api Compatibility Level.

    I'm not sure why I marked this as Won't Fix - that was an error. Sorry!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.