Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] fix System.Text.Json with default trimm…
…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
- Loading branch information