.NET Core MVC Page Not Refreshing After Changes

后端 未结 10 484
花落未央
花落未央 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:32

    You should just add this:

    services.AddControllersWithViews();
    

    to the ConfigureService method.

    Be aware below code is not available in ASP.NET Core 3.1:

    services.AddControllersWithViews().AddRazorRuntimeCompilation();
    

提交回复
热议问题