Posts

Showing posts from October, 2019

Resolved Issue in Asp core 3.0 serializersettings does not exist in AddJsonOptions

Hello, When we want to use serializersettings  function in configure service (IN startup .cs) for CamelCasing .then we get this issue  in asp core 3.0. So we can resolve it by adding below code in configure service file public void ConfigureServices(IServiceCollection services) { services.AddMvc(setupAction => { setupAction.EnableEndpointRouting = false; }).AddJsonOptions(jsonOptions => { jsonOptions.JsonSerializerOptions.PropertyNamingPolicy = null; }) .SetCompatibilityVersion(CompatibilityVersion.Version_3_0);

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

In this article i will provide the solution how to recompile asp core 3.0 application and show the changes on browser when we change something in Razor (views)  while debug mode . Applications that require runtime compilation or re-compilation of Razor files should: Add a reference to the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package. It'll be available as part of the 3.0.0-preview3 release. Update the application's ConfigureServices to include a call to AddMvcRazorRuntimeCompilation: public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddRazorRuntimeCompilation(); } }