Is there any hot reload for blazor server-side?

前端 未结 6 2107
萌比男神i
萌比男神i 2020-12-25 12:08

I have just one, quick question. Is there way to hot reload a blazor app? At least, .razor files? Now I\'m hosting my app on local IIS (not IIS express).

I was looki

6条回答
  •  不知归路
    2020-12-25 12:33

    Thijs Tijsma had a post that worked for me.

    You have to run without the debugger attached in Visual Studio (CTRL + F5 in Visual Studio)

    in the Pages\_host.cshtml add

    
    
    
    
    
        
    
    

    Then just make the reload js file wwwroot\scripts\HotReload.js

    window.Blazor.defaultReconnectionHandler.onConnectionDown = function ()
    {
        window.location.reload();
    };
    

提交回复
热议问题