浏览器链接未刷新Chrome中的页面 [英] Browser Link not refreshing page in Chrome

查看:106
本文介绍了浏览器链接未刷新Chrome中的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am following this documentation to enable Browser Link and set up a new Blazor project (targeting .NET Core 3) using the provided template (running Visual Studio 16.3.9, which is latest as of writing).

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

As mentioned in the documentation I have installed the nuget package Microsoft.VisualStudio.Web.BrowserLink and added the middleware to my Startup.cs

public class Startup 

    // ...

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

        // ...

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

When starting the application and opening the Browser Link Dashboard I see the browser as connected:

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

However when making a change, e.g adding <Counter /> to Index.razor, the change is not getting reflected in my browser window.

当我从Visual Studio中单击刷新"按钮时,浏览器窗口似乎在刷新,但未显示更改.使用浏览器的刷新"按钮手动刷新页面时,也是如此.

When I hit the refresh button from within Visual Studio, the browser window seems to refresh, but does not show the changes. The same applies when manually refreshing the page by using the browsers refresh button.

更有趣的是,当在Debug模式下运行时,刷新似乎可以正常工作.

Even more interesting is the fact, that when not running in Debug mode the refresh seems to work.

我在这里做错了什么?

What am I doing wrong here?

推荐答案

似乎blazor不支持使用调试器(F5)进行实时重载,但不使用调试器(ctrl-F5)即可.

It seems that blazor does not support live reloading with debugger(F5) but without debugger (ctrl-F5) works.

参考

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

为什么在刷新后页面不更新. cshtml更改

这篇关于浏览器链接未刷新Chrome中的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆