asp.net-mvc - AspNet核心3.0和3.1 : Enable runtime compilation for Razor Pages

标签 asp.net-mvc asp.net-core visual-studio-2019

自 ASP.Net Core 3.0 及更高版本起:

A) 在运行应用程序时编辑 Razor View (.cshtml) 文件在重新启动之前不会应用更改。

B)看起来编辑并继续不起作用。

IDE 和版本: 微软 Visual Studio 2019

最佳答案

对于这个问题,建议您尝试安装包Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation然后配置AddRazorRuntimeCompilationStartup.cs就像

public void ConfigureServices(IServiceCollection services)
{
    services.AddControllersWithViews().AddRazorRuntimeCompilation();
}

对于这个问题,您可以通过 Breaking changes to runtime compilation for Razor views and Razor Pages #343 进行追踪

关于asp.net-mvc - AspNet核心3.0和3.1 : Enable runtime compilation for Razor Pages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58173846/

相关文章:

asp.net - DBContext.Entry 的作用是什么?

jquery - MVC 贡献网格

visual-studio-2015 - 在发布时应用 EF 迁移仅适用于某些 Web 项目

nuget - 如何在 Visual Studio 2019 上使用 github nuget 包

visual-studio - Visual Studio IDE - 有没有办法在特定位置打开控制台窗口

asp.net-mvc - HttpContext 中需要什么来允许 FormsAuthentication.SignOut() 执行?

asp.net-mvc - 我必须更改 Azure 的 ASP MVC 身份验证系统吗?

c++ - 如何在 Visual Studio 2019 中禁用 C++ 的特定警告?

jquery - 使用 ASP.NET Core 和 JQuery 启用防伪 token

c# - 考虑在设计时使用 IDbContextFactory 覆盖 DbContext 的初始化