How to set json serializer settings in asp.net core 3?

AddMvc returns an IMvcBuilder implementation, which has a corresponding AddJsonOptions extension method. The new-style methods AddControllers, AddControllersWithViews, and AddRazorPages also return an IMvcBuilder implementation. Chain with these in the same way you would chain with AddMvc: services.AddControllers() .AddJsonOptions(options => { // … }); Note that options here is no longer for Json.NET, but for the … Read more

.NET Core 3.0: Razor views don’t automatically recompile on change

For ASP.NET Core 3 release version: services.AddControllersWithViews().AddRazorRuntimeCompilation(); https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-3.0 It can also be enabled conditionally only for local development, quoted from the link: Runtime compilation can be enabled such that it’s only available for local development. Conditionally enabling in this manner ensures that the published output: Uses compiled views. Is smaller in size. Doesn’t enable file … Read more