Reputation: 564
I am getting an error while migrating from .net core 2.1 to .net core 3.1
Error: The Microsoft.AspNetCore.All package is not supported when targeting .NET Core 3.0 or higher. A FrameworkReference to Microsoft.AspNetCore.The app should be used instead and will be implicitly included by Microsoft.NET.Sdk.Web.
Upvotes: 0
Views: 4999
Reputation: 20116
i am getting issue with services.AddMvc(options => { options.Filters.Add(new AuthorizeFilter("default")); }).AddJsonOptions(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize) 'JsonOptions' does not contain a definition for 'SerializerSettings'
For asp.net core 3.0+,you need to install the package Microsoft.AspNetCore.Mvc.NewtonsoftJson for your version firstly,then replace
services.AddMvc()
.AddJsonOptions(
options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize);
with
services.AddControllersWithViews()
.AddNewtonsoftJson(options =>
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize);
Upvotes: 3