1.安装Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation包
2.在Startup中ConfigureServices方法里面加入services.AddMvc().AddRazorRuntimeCompilation();