Description
Calling XmlSerializer.Deserialize ends up throwing a System.ExecutionEngineException: "Attempting to JIT compile method 'void Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializerContract:.ctor ()' while running in aot-only mode."
EXCEPTION: System.InvalidOperationException: XmlSerializeErrorDetails, 0, 0
---> System.ExecutionEngineException: Attempting to JIT compile method 'void Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializerContract:.ctor ()' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object , Object[] , Boolean ) in System.Private.CoreLib.dll:token 0x600269a+0x5
Exception_EndOfInnerExceptionStack
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader , String , XmlDeserializationEvents ) in System.Private.Xml.dll:token 0x6001b05+0x10d
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader , String ) in System.Private.Xml.dll:token 0x6001b04+0x0
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader ) in System.Private.Xml.dll:token 0x6001b02+0x0
at MySimpleApp.Program.XmlSerializationTest.Response.Deserialize(String xml) in /Users/rolf/work/maccore/main/xamarin-macios/tests/dotnet/MySimpleApp/AppDelegate.cs:line 67
at MySimpleApp.Program.XmlSerializationTest.Bug1820_GenericList() in /Users/rolf/work/maccore/main/xamarin-macios/tests/dotnet/MySimpleApp/AppDelegate.cs:line 184
at MySimpleApp.Program.Main(String[] args) in /Users/rolf/work/maccore/main/xamarin-macios/tests/dotnet/MySimpleApp/AppDelegate.cs:line 22
Test code: https://github.com/rolfbjarne/xamarin-macios/blob/c8014a6b6fd759159b409df19062f11b57ae8e2c/tests/dotnet/MySimpleApp/AppDelegate.cs#L21-L187
To reproduce:
-
Download & install Xcode 13 beta 3.
-
Clone my fork of xamarin-macios, and checkout the Bug1820_GenericList-testcase branch, and build it:
git clone https://github.com/rolfbjarne/xamarin-macios
git checkout Bug1820_GenericList-testcase
cd xamarin-macios
./configure --enable-dotnet --enable-xamarin
make reset
make all -j8
make install -j8
-
Connect an iOS device
-
Build & run the test project:
make -C tests/dotnet/MySimpleApp/iOS run-dev
Configuration
6.0.100-rc.1.21377.4
Regression?
With regards to legacy Xamarin, yes.
Description
Calling XmlSerializer.Deserialize ends up throwing a System.ExecutionEngineException: "Attempting to JIT compile method 'void Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializerContract:.ctor ()' while running in aot-only mode."
Test code: https://github.com/rolfbjarne/xamarin-macios/blob/c8014a6b6fd759159b409df19062f11b57ae8e2c/tests/dotnet/MySimpleApp/AppDelegate.cs#L21-L187
To reproduce:
Download & install Xcode 13 beta 3.
Clone my fork of xamarin-macios, and checkout the
Bug1820_GenericList-testcasebranch, and build it:Connect an iOS device
Build & run the test project:
Configuration
6.0.100-rc.1.21377.4
Regression?
With regards to legacy Xamarin, yes.