Comments (14)

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));
```

exception:

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

Fiedel

May 14, 2019 07:45

This issue appears to persist in Unity 2018.3.14

YoloJero

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.

nilsubimax

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?

Arctous

Sep 13, 2018 20:53

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

Mgravitus

Aug 06, 2018 15:02

So which version of Unity is this fixed for IL2CPP?

Arctous

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.

Arctous

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.

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!