View code changes without restarting the server

为君一笑 提交于 2019-12-05 10:21:35

This is the expected behavior. You can use something like gulp-aspnet-k to automate this process. More detailed info available here: Building and Running Your ASP.NET vNext Application with Gulp.

Note that this gulp integration unfortunately only works on Windows now but all it does is to watch the dnx process and restart it again.

The change code on the fly feature works only when running without debugging. I assume you just press F5 (debug) from VS which actually attaches a debugger. Try without and it should work.

Long story short: in order to refresh the code behind, the server has to restart. When running from the command line, the server stops and never restarts - you have to handle that yourself, like @tugberk suggested - but when running from VS, tooling takes care of that for you.

There is a command you can use for this, called dnx-watch. It didn't exist when the original question was asked, but was added in beta 8 in September 2015. You install it using

dnu commands install Microsoft.Dnx.Watcher You run it by simply passing to it the command you would have passed to dnx. So, replace

dnx web

with

dnx-watch web

You can learn more here: http://ardalis.com/get-started-with-dnx-watch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!