diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj index a90b113dc3..c0330fc577 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj @@ -26,6 +26,7 @@ + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index b094505f6c..1600419ccb 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs @@ -15,6 +15,7 @@ using System.Reflection; using Volo.Abp.ApiVersioning; using Volo.Abp.AspNetCore.Mvc.Conventions; using Volo.Abp.AspNetCore.Mvc.DependencyInjection; +using Volo.Abp.AspNetCore.Mvc.Json; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.VirtualFileSystem; using Volo.Abp.DependencyInjection; @@ -76,6 +77,11 @@ namespace Volo.Abp.AspNetCore.Mvc ); var mvcBuilder = context.Services.AddMvc() + .AddNewtonsoftJson(options => + { + options.SerializerSettings.ContractResolver = + new AbpMvcJsonContractResolver(context.Services); + }) .AddRazorRuntimeCompilation() .AddDataAnnotationsLocalization(options => { @@ -110,11 +116,6 @@ namespace Volo.Abp.AspNetCore.Mvc { mvcOptions.AddAbp(context.Services); }); - - //Configure(jsonOptions => @3.0.0! - //{ - // jsonOptions.SerializerSettings.ContractResolver = new AbpMvcJsonContractResolver(context.Services); - //}); } public override void OnApplicationInitialization(ApplicationInitializationContext context)