Reputation: 30355
I have this command (default one) in project.json:
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
Now after I do run Kestrel and change my controller there is no automatic update. As far as I remember it did work in beta-8 automatically (when there was IISExpress). Is there a way to make the same now?
P.S. I also did not find any command apart from Ctrl+C that closes the server that you can run in command line. Maybe there is some hidden one that restarts it?
Update: It seems that we need to run "dnx-watch web", but Visual Studio by default runs "dnx" command. I am not sure how this can be changed (or if it's possible to change "dnx" to "dnx-watch"
Upvotes: 1
Views: 828
Reputation: 546
Here's what I did based on @tugberk's answer.
dnu commands install Microsoft.Dnx.Watcher
var shell = require('gulp-shell');
to gulpfile.jsgulp.task('watch', shell.task(['dnx-watch web']));
to gulpfile.jsdnx-watch
to run when you open your project, add the 'watch' task as a Project Open binding within the Task Runner Explorer.Now if you make a change to your code and hit ctrl+s, dnx-watch will restart your app without you needing to explicitly build the project.
Upvotes: 2
Reputation: 58494
You can use dnx-watch. Here is more info: Integrating Visual Studio Code with dnx-watch to develop ASP.NET 5 applications.
Upvotes: 2