-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add support for XsdDataContractExporter for mobile #6376
Copy link
Copy link
Closed
Description
We're updating the Microsoft ASP.NET Web API Client package to support .NET Standard 2.0. This library uses the XsdDataContractExporter to detect if a type has a data contract, but it looks like XsdDataContractExporter throws NotSupportedExceptions on Xamarin.Android:
12-15 06:13:09.949 E/mono (12122):
12-15 06:13:09.949 E/mono (12122): Unhandled Exception:
12-15 06:13:09.949 E/mono (12122): System.TypeInitializationException: The type initializer for 'System.Net.Http.FormattingUtilities' threw an exception. ---> System.NotImplementedException: The method or operation is not implemented.
12-15 06:13:09.949 E/mono (12122): at System.Runtime.Serialization.XsdDataContractExporter..ctor () [0x00006] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/System.Runtime.Serialization/ReferenceSources/XsdDataContractExporter_mobile.cs:39
12-15 06:13:09.949 E/mono (12122): at System.Net.Http.FormattingUtilities..cctor () [0x000e4] in <a96925ecdb904c5c931a865f71021787>:0
12-15 06:13:09.949 E/mono (12122): --- End of inner exception stack trace ---
12-15 06:13:09.949 E/mono (12122): at System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor () [0x0000b] in <a96925ecdb904c5c931a865f71021787>:0
12-15 06:13:09.949 E/mono (12122): at System.Net.Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters () [0x00000] in <a96925ecdb904c5c931a865f71021787>:0
12-15 06:13:09.949 E/mono (12122): at System.Net.Http.Formatting.MediaTypeFormatterCollection..ctor () [0x00000] in <a96925ecdb904c5c931a865f71021787>:0
12-15 06:13:09.949 E/mono (12122): at System.Net.Http.HttpContentExtensions.get_DefaultMediaTypeFormatterCollection () [0x00007] in <a96925ecdb904c5c931a865f71021787>:0
12-15 06:13:09.949 E/mono (12122): at System.Net.Http.HttpContentExtensions.ReadAsAsync[T] (System.Net.Http.HttpContent content) [0x00000] in <a96925ecdb904c5c931a865f71021787>:0
12-15 06:13:09.949 E/mono (12122): at Phoneword.Test+<ReadAsJsonAsync>d__2.MoveNext () [0x00134] in C:\Users\kichalla\Downloads\Phoneword\Phoneword\Test.cs:22
12-15 06:13:09.949 E/mono (12122): --- End of stack trace from previous location where exception was thrown ---
12-15 06:13:09.949 E/mono (12122): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
12-15 06:13:09.949 E/mono (12122): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
12-15 06:13:09.949 E/mono (12122): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
12-15 06:13:09.949 E/mono (12122): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
12-15 06:13:09.949 E/mono (12122): at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
12-15 06:13:09.949 E/mono (12122): at Phoneword.MainActivity+<OnCreate>d__0.MoveNext () [0x00053] in C:\Users\kichalla\Downloads\Phoneword\Phoneword\MainActivity.cs:17
Any plans to add support for XsdDataContractExporter for mobile?
Reactions are currently unavailable