Header add

 In this article we will learn about ASP.NET Core 6 – Enabling Razor runtime compilation.


Recently I have created a Razor file project I facing razor runtime compilation issue in ASP.Net Core 6. Razor files (.cshtml) are compiled at both build and publish time and this gives better performance as your views are compiled.

Runtime Compilation

Runtime complication issue means on the demand if we can change the HTML/CsHTML then it reflect immediately OR we can say runtime compilation is which will help developers to see any modified view change in real-time, without starting the application again. 

The recent version of ASP.NET Core (ASP.NET Core 6.0).


To enable Razor runtime compilation in ASP.NET Core 6.0

You need to add the package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation from NuGet package.

microsoft-aspnetcore-mvc-razor-runtimecompilation



ASP.NET-Core-6-Enabling-Razor-runtime-compilation

Once the changes has been done, you can see the Razor compilation issue is resolved and you can get the result on demand.

Summary
In this tutorial we discussed ASP.NET Core 6 – Enabling Razor runtime compilation. If have any question related to this topic then give your feedback.

Post a Comment

Previous Post Next Post