.NET Core MVC Page Not Refreshing After Changes

后端 未结 10 474
花落未央
花落未央 2020-12-04 10:09

I\'m building a .NET Core MVC on the latest version 2.2. I have a problem when I make changes to the CSHTML file and refresh the page, my changes are not reflected in the br

10条回答
  •  醉梦人生
    2020-12-04 10:22

    For those using Net core 3.0 or greater

    1. Go to Tools → Nuget package manager → Manage nuget pakages for solution

    2. move to browse tab to browse from internet

    3. search for RuntimeCompilation Click on Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation

    4. install it on your intended projects the current stable version

    5. open Startup.cs file

    6. go to void method ConfigureServices

    7. add line: services.AddControllersWithViews().AddRazorRuntimeCompilation();

    8. you are DONE

    Rerun and see. Now you can refresh your views or pages.

提交回复
热议问题