vs2019开发net core3.x修改视图页面后,刷新浏览器看不到修改后的效果
电脑版发表于:2019/12/11 16:06
一:安装依赖包
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet 包。
Install-Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -Version 3.0.0
二:增加AddRazorRuntimeCompilation
public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews().AddRazorRuntimeCompilation(); }
官方解释:https://docs.microsoft.com/zh-cn/aspnet/core/mvc/views/view-compilation?view=aspnetcore-3.0