AspNet Core 3.0和3.1:启用Razor页面的运行时编译

编程入门 行业动态 更新时间:2024-10-10 21:32:56
本文介绍了AspNet Core 3.0和3.1:启用Razor页面的运行时编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

自ASP.Net Core 3.0版和更高版本开始:

Since ASP.Net Core version 3.0 and higher:

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

A) Editing a Razor View (.cshtml) file while running the application does not apply the changes until restart.

B)似乎编辑和继续操作不起作用.

B) Looks like edit and continue is not working.

IDE和版本: Microsoft Visual Studio 2019

IDE and Version: Microsoft Visual Studio 2019

推荐答案

对于此问题,建议您尝试安装软件包Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation,然后像在

For this issue, I suggest you try to install package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation and then configure AddRazorRuntimeCompilation in Startup.cs like

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

对于此问题,您可以通过对Razor视图和Razor页面的运行时编译进行重大更改,以进行跟踪. 343

For this issue, you could trace by Breaking changes to runtime compilation for Razor views and Razor Pages #343

更多推荐

AspNet Core 3.0和3.1:启用Razor页面的运行时编译

本文发布于:2023-11-16 14:42:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1605207.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   Core   AspNet   Razor

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!