Browser Link not refreshing page in Chrome

狂风中的少年 提交于 2020-01-25 06:52:27

问题


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).

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();
        }

        // ...

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

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

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.

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

What am I doing wrong here?


回答1:


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

Refer to

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

Why does page not update after refresh when .cshtml changes



来源:https://stackoverflow.com/questions/58861948/browser-link-not-refreshing-page-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!