-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a centralized way to disable ExpressionValueProvider or fix DynamicCodeGeneration check #2919
Comments
Most probably that an answer here is to switch to STJ as it was designed in AOT friendly way. |
This might be fixed here? #2902 |
The mobile app inherited a lot of code from an older WinForms application. Migrating everything to STJ (and making sure nothing else broke) would take some work.
It might be! I'll test after 13.0.4 is released. |
13.0.4? #2902 was merged more than 2 years ago. |
My bad. |
ExpressionValueProvider
does not work on iOS in AOT-only mode and throws exceptions likeSystem.AggregateException: Attempting to JIT compile method '(wrapper delegate-invoke) void <Module>:invoke_callvirt_void_Account_TimingEnum (COMPANY_NAME.Account,COMPANY_NAME.Enums.TimingEnum)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
ReflectionValueProvider
works. But, there is no easy way to switch the entire app fromExpressionValueProvider
toReflectionValueProvider
. Currently as a workaround we are creating custom contract resolversand then using the custom contract resolvers in the app itself, SignalR, RestSharp and other libraries (which all require separate configuration).
Please do one of the following:
ExpressionValueProvider
, something likeDefaultContractResolver.DisableExpressionValueProvider = true
.DynamicCodeGeneration
check insideDefaultContractResolver.CreateMemberValueProvider
(which is also supposed to detect thatExpressionValueProvider
won't work) innetstandard2.0
andnet6.0
builds of Newtonsoft.Json, and perhaps makeJsonTypeReflector.DynamicCodeGeneration
settable.The text was updated successfully, but these errors were encountered: