diff --git a/build/common.ps1 b/build/common.ps1 index 64ef942f74..172e22ad6a 100644 --- a/build/common.ps1 +++ b/build/common.ps1 @@ -6,12 +6,12 @@ $rootFolder = (Get-Item -Path "./" -Verbose).FullName # List of solutions used only in development mode $solutionPaths = @( - # "../framework", + "../framework", "../modules/basic-theme", "../modules/users", "../modules/permission-management", "../modules/setting-management", - # "../modules/feature-management", + "../modules/feature-management", "../modules/identity", "../modules/identityserver", "../modules/tenant-management", diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs index 43a9c04d32..42e7c9ac22 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs @@ -30,6 +30,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Json options.JsonSerializerOptions.Converters.Add(new ObjectToInferredTypesConverter()); options.JsonSerializerOptions.Converters.Add(new AbpHasExtraPropertiesJsonConverterFactory()); + + // Remove after this PR. + // https://github.com/dotnet/runtime/pull/51739 + options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict; } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs index e2e1627bd1..54c343b6ad 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text.Json; +using System.Text.Json.Serialization; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Volo.Abp.Data; using Volo.Abp.Json.SystemTextJson.JsonConverters; @@ -49,6 +50,11 @@ namespace Volo.Abp.EntityFrameworkCore.ValueConverters var deserializeOptions = new JsonSerializerOptions(); deserializeOptions.Converters.Add(new ObjectToInferredTypesConverter()); + + // Remove after this PR. + // https://github.com/dotnet/runtime/pull/51739 + deserializeOptions.NumberHandling = JsonNumberHandling.Strict; + var dictionary = JsonSerializer.Deserialize(extraPropertiesAsJson, deserializeOptions) ?? new ExtraPropertyDictionary(); diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs index 4de6e96bcc..26c217a291 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs @@ -1,5 +1,6 @@ using System; using System.Text.Encodings.Web; +using System.Text.Json.Serialization; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Json.SystemTextJson.JsonConverters; @@ -28,6 +29,10 @@ namespace Volo.Abp.Json.SystemTextJson // If the user hasn't explicitly configured the encoder, use the less strict encoder that does not encode all non-ASCII characters. options.JsonSerializerOptions.Encoder ??= JavaScriptEncoder.UnsafeRelaxedJsonEscaping; + + // Remove after this PR. + // https://github.com/dotnet/runtime/pull/51739 + options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict; } } }