.NET Core 3.0中的BrowserLink

5

将 .Net Core 2.2 升级至 .Net Core 3.0 后,我的浏览器链接无法正常工作,有人知道如何解决吗?
编辑 cshtml 并刷新浏览器后,更改并未反映出来。


我在这里找到了关于它的一个帖子:https://developercommunity.visualstudio.com/content/problem/793030/browserlink-not-updating-page-on-save.html。 我刚刚更新到Visual Studio 16.4.0,但是使用.NET Core 3.1仍然存在问题。 :-/ - Juan Carlos Puerto
T___T 这使得开发过程变得非常繁琐和缓慢。 - Herman
1个回答

7

这里提出的解决方法有所帮助:点击此处查看

  • 添加NuGet包Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
  • services.AddControllersWithViews();改为services.AddControllersWithViews().AddRazorRuntimeCompilation();
  • 保存后需要单击浏览器链接刷新按钮Ctrl+Alt+Enter,但这比重新启动应用程序要好

    enter image description here


在 .NET 5 Razor Pages 和 Firefox 上无法工作。 - mxmissile

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接