ServiceStack: Self-Host LiveReload not working

前端 未结 2 414
鱼传尺愫
鱼传尺愫 2021-01-25 03:13

I have a self hosted ServiceStack application which I intend to use to develop an angular application with.

The problem is, previously, every time I\'ve made a change to

相关标签:
2条回答
  • 2021-01-25 03:51

    You need to set the AppHost config to debug mode:

    SetConfig(new HostConfig {
        DebugMode = true,
    });
    

    For performance reasons changes are only monitored for in Debug mode. See here for more information.

    Automatic reload of modified views, layout templates and partials (in Debug mode)

    The best way to avoid the Start-Up penalty is to avoid having to restart the AppDomain in the first place. So in Debug Mode we'll also do this where a background file system watcher monitors all pages, partials and Layout templates for modifications and recompiles and auto-reloads them on the fly, all-ready to deliever instant response time once the page is requested.

    0 讨论(0)
  • 2021-01-25 03:59

    The issue is that he was changing the source file and not the output file. Since SS copies the files to /bin/debug he needed to change that version.

    Using HostConfig settings, we were able to to use the WebHostPhysicalPath property in the following way during development, while setting up the SS Config:

    SetConfig(new HostConfig {
    #if DEBUG
        DebugMode = true,
        WebHostPhysicalPath = Path.GetFullPath(Path.Combine("~".MapServerPath(), "..", "..")),
    #endif
    });
    

    This took us out of /bin/debug and back to the source.

    0 讨论(0)
提交回复
热议问题