.NET Core MVC Page Not Refreshing After Changes

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

    Below helped me when views were in separate project.

    if(HostingEnvironment.IsDevelopment()){ // only in development (optional)
        services.AddMvc().AddRazorOptions(o => {
            o.FileProviders.Add(new PhysicalFileProvider(PATH_TO_PROJECT));
        });
    }
    

提交回复
热议问题