【问题标题】:Browser Link not refreshing page in Chrome浏览器链接不刷新 Chrome 中的页面
【发布时间】:2019-11-14 16:52:07
【问题描述】:

我正在关注this 文档以启用浏览器链接并使用提供的模板(运行 Visual Studio 16.3.9,截至撰写时最新)设置一个新的 Blazor 项目(以.NET Core 3 为目标)。

如文档中所述,我已经安装了 nuget 包 Microsoft.VisualStudio.Web.BrowserLink 并将中间件添加到我的 Startup.cs

public class Startup 

    // ...

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
            app.UseBrowserLink();
        }

        // ...

当启动应用程序并打开Browser Link Dashboard 时,我看到浏览器已连接:

但是在进行更改时,例如将 <Counter /> 添加到 Index.razor,更改不会反映在我的浏览器窗口中。

当我在 Visual Studio 中点击刷新按钮时,浏览器窗口似乎刷新了,但没有显示更改。使用浏览器刷新按钮手动刷新页面时也是如此。

更有趣的是,当在调试模式下运行时,刷新似乎可以工作。

我在这里做错了什么?

【问题讨论】:

    标签: c# google-chrome visual-studio-2019 blazor asp.net-core-3.0


    【解决方案1】:

    似乎blazor 不支持使用调试器(F5)但没有调试器(ctrl-F5)的实时重新加载。

    参考

    https://github.com/aspnet/AspNetCore/issues/15613#issuecomment-430810677

    Why does page not update after refresh when .cshtml changes

    【讨论】:

      猜你喜欢
      • 2021-01-13
      • 1970-01-01
      • 2020-08-12
      • 2021-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多