5

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

enter image description here

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:

enter image description here

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?

Matthias Güntert
  • 4,013
  • 6
  • 41
  • 89

1 Answers1

2

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

Ryan
  • 19,118
  • 10
  • 37
  • 53