-
Notifications
You must be signed in to change notification settings - Fork 518
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
Look into whether we need updates to enable/disable JsonSerializerIsReflectionEnabledByDefault #18057
Comments
rolfbjarne
changed the title
Look into whether we need up to date to enable/disable JsonSerializerIsReflectionEnabledByDefault
Look into whether we need updates to enable/disable JsonSerializerIsReflectionEnabledByDefault
Apr 13, 2023
Looks like we need to set the property to true. Ref: dotnet/maui#16038 |
We should also add a trivial test: System.Text.Json.JsonSerializer.Serialize(42) |
rolfbjarne
added a commit
to rolfbjarne/xamarin-macios
that referenced
this issue
Aug 11, 2023
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this issue
Aug 11, 2023
…er settings Fixes: dotnet/maui#16038 Changes to trimmer defaults in .NET 8 require a new `$(JsonSerializerIsReflectionEnabledByDefault)` MSBuild property to be set by default for project types that use `$(TrimMode)=partial` like when running on mobile (iOS/Android). I added a very basic System.Text.Json test, which fails with the exception: System.InvalidOperationException : JsonSerializerIsReflectionDisabled at System.Text.Json.JsonSerializerOptions.ConfigureForJsonSerializer() at System.Text.Json.JsonSerializer.GetTypeInfo(JsonSerializerOptions , Type ) at System.Text.Json.JsonSerializer.Deserialize(String , Type , JsonSerializerOptions ) at System.Text.JsonTests.JsonSerializerTest.Deserialize() at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object , BindingFlags ) Simply running the test again with the MSBuild property set allows the test to pass. This will be a good smoke test for System.Text.Json going forward. The iOS side of this is tracked here: xamarin/xamarin-macios#18057
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this issue
Aug 11, 2023
…er settings Fixes: dotnet/maui#16038 Changes to trimmer defaults in .NET 8 require a new `$(JsonSerializerIsReflectionEnabledByDefault)` MSBuild property to be set by default for project types that use `$(TrimMode)=partial` like when running on mobile (iOS/Android). I added a very basic System.Text.Json test, which fails with the exception: System.InvalidOperationException : JsonSerializerIsReflectionDisabled at System.Text.Json.JsonSerializerOptions.ConfigureForJsonSerializer() at System.Text.Json.JsonSerializer.GetTypeInfo(JsonSerializerOptions , Type ) at System.Text.Json.JsonSerializer.Deserialize(String , Type , JsonSerializerOptions ) at System.Text.JsonTests.JsonSerializerTest.Deserialize() at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object , BindingFlags ) Simply running the test again with the MSBuild property set allows the test to pass. This will be a good smoke test for System.Text.Json going forward. The iOS side of this is tracked here: xamarin/xamarin-macios#18057
jonathanpeppers
added a commit
to dotnet/android
that referenced
this issue
Aug 14, 2023
…er settings (#8266) Fixes: dotnet/maui#16038 Changes to trimmer defaults in .NET 8 require a new `$(JsonSerializerIsReflectionEnabledByDefault)` MSBuild property to be set by default for project types that use `$(TrimMode)=partial` like when running on mobile (iOS/Android). I added a very basic System.Text.Json test, which fails with the exception: System.InvalidOperationException : JsonSerializerIsReflectionDisabled at System.Text.Json.JsonSerializerOptions.ConfigureForJsonSerializer() at System.Text.Json.JsonSerializer.GetTypeInfo(JsonSerializerOptions , Type ) at System.Text.Json.JsonSerializer.Deserialize(String , Type , JsonSerializerOptions ) at System.Text.JsonTests.JsonSerializerTest.Deserialize() at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object , BindingFlags ) Simply running the test again with the MSBuild property set allows the test to pass. This will be a good smoke test for System.Text.Json going forward. The iOS side of this is tracked here: xamarin/xamarin-macios#18057
rolfbjarne
added a commit
that referenced
this issue
Aug 15, 2023
Fixed in f8b7b53. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refs:
PublishTrimmed=true
dotnet/runtime#84378Depending on what happens with these issues, we might have to update something on our end.
So this is just an issue to not forget to do whatever needs to be done once we know if anything actually needs to be done.
The text was updated successfully, but these errors were encountered: