Giter Club home page Giter Club logo

Comments (9)

glennc avatar glennc commented on July 20, 2024

@davidfowl We said to move this bug to here, but does it actually make sense? Can hosting actually do it?

from hosting.

seanfuture avatar seanfuture commented on July 20, 2024

In case useful to anyone on Mac OS X ( as a temporary stop-gap ), I've created the following scripts which implement file system watching for the sample HelloMVC project, as listed below. This is used in conjunction w/ LiveReload for non-compiled file changes. To start the script, run ./watch.sh from the Terminal ( scripts copied to root of HelloMVC example ):

#/!bin/sh
# watch.sh - FS watcher for ASP.NET vNext on Mac OS X
# .. Used in conjunction with ./auto-restart.sh
# .. To use run ./watch.sh from the Terminal
# Startup
pkill -f kestrel
pkill -15 screen
screen -S vnext -d -m
screen -S vnext -p 0 -X stuff $'k kestrel\n'
# Start file system watch ..
fswatch -o ./Controllers ./Models | xargs -n1 ./auto-restart.sh
#/!bin/sh
# auto-restart.sh - Restart component for ASP.NET vNext on Mac OS X
# .. Used in conjunction with ./watch.sh
# screen -S vnext -p 0 -X stuff $'pkill -f kestrel\n'
screen -S vnext -p 0 -X stuff $'q\n'
while [ 1 ]
do
    pid=`ps -ef | grep "kestrel" | grep -v grep | awk ' {print $2}'`
    if [ "$pid" = "" ]
    then
            screen -S vnext -p 0 -X stuff $'k kestrel\n'
            exit
    fi
    sleep 0.05
done

You may wish to sudo chmod +x watch.sh; sudo chmod +x auto-restart.sh before running. There is a slight pause / down-time incurred while the web server restarts itself. "brew install fswatch" was run to install fswatch. Additional code paths must be added to the "fswatch" line in watch.sh.

Above scripts are not affiliated w/ ASP.NET vNext and aren't officially supported of course - Rather, thought they might be of interest to at least one individual.

I'm sure a more elegant and streamlined solution is in the works.

from hosting.

Praburaj avatar Praburaj commented on July 20, 2024

@glennc is this still a problem? I think we do restart the process when we pass in a --watch switch while starting the dnx process right?

from hosting.

akamud avatar akamud commented on July 20, 2024

I'm testing this on Windows and --watch just kills the process without restarting it.

By looking at the code here, it doesn't restart.

from hosting.

mykebates avatar mykebates commented on July 20, 2024

I am seeing the same on Windows and Mac.

from hosting.

Tratcher avatar Tratcher commented on July 20, 2024

@davidfowl? I recall that this is intended. --watch looks for file changes and kills the process, but it relies on another process to monitor it and re-start it. IIS does this for us, and I think VS does also.

from hosting.

seanfuture avatar seanfuture commented on July 20, 2024

If you're thinking of leaving it as-is, then the current setup will continue to be relatively substandard for those not using IIS compared to alternate technologies. In Node.js when using grunt / gulp, for example, FS watchers and automatic restarts of web servers are common place and super convenient. I recommend modernizing the toolchain for those who don't use IIS to support this and potentially offer a different switch / default behavior depending on settings and/or environment.

from hosting.

muratg avatar muratg commented on July 20, 2024

I don't recall the discussion around having another process doing the restart for you - this is for sure not the case for cross plat. @lodejard @davidfowl any suggestions here? I'm leaning towards doing the restart here.

from hosting.

Tratcher avatar Tratcher commented on July 20, 2024

Going back to aspnet/dnx#1795 as the primary discussion thread.

from hosting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.