netcore 3.1 This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32.

安装  Microsoft.AspNetCore.Mvc.Newtonsoft  包

在startup.cs中添加

public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            services.AddMvcCore().AddNewtonsoftJson(options => {
                options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
            });
            RegisterMyServices(services);
        }

 

posted @ 2020-02-09 15:56  天天的蓝色  阅读(519)  评论(0编辑  收藏  举报