Search code examples
visual-studio.net-corebrowser-link

BrowserLink in .Net Core 3.0


Upgrading .Net Core 2.2 to .Net Core 3.0 my browser link is become not working, anyone know how to troubleshoot.
Performing the edit cshtml and refresh the browser it didn't reflect the changes.


Solution

  • The workaround suggested here helps:

    • Add the NuGet package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
    • Change services.AddControllersWithViews(); by services.AddControllersWithViews().AddRazorRuntimeCompilation();
    • After saving you need to click the Browser Link refresh button Ctrl+Alt+Enter but it's better than restarting the application

      enter image description here