Click here to Skip to main content
15,884,176 members
Articles / All Topics

dnx-watch - A no-compile Developer Experience

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
16 Oct 2015MIT1 min read 5.4K  
dnx-watch - A no-compile Developer Experience

If you’re using Visual Studio 2015 for ASP.NET 5 development, you can leaverage no-compile developer experience from Visual Studio, powered by Roslyn. This feature helps developers to see the code changes without compiling the source code. This feature was not available for DNX / K runtimes. There are some third party solutions available like kmon, which monitors the directory and restarts the server without user interaction. Long back, I also wrote a C# wrapper on top of (K runtime)[http://dotnetthoughts.net/k-web-command-and-agile-development-environment/]. The implementation is pretty strainght forward, using a filewatcher, I will be monitoring the directory and if there is any change, I will restart server. In case of project.json file, I will be executing the package restore command and restart the server. In ASP.NET5 Beta 8, ASP.NET team created a wrapper on top of DNX command, it is called dnx-watch. The dnx-watch command will run your application and then watch all of the project files for changes. When a file is changed, the dnx-watch command restarts the application. This enables a rapid development workflow where you edit the code, save, and then refresh your browser to see the changes. You can install dnx-watch using dnu.

dnu commands install Microsoft.Dnx.Watcher

Once installation is completed, you can start dnx-watch command, from the same directory where project.json is located, all the parameters required for dnx command can be passed to dnx-watch, which will be passed to dnx.

dnx-watch web

This will start the dnx-watch command, and which will monitor the directory for changes. Here is the screenshot of dnx-watch running on my system.

dnx-watch running on my system

Happy programming!

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Technical Lead
India India
Working as Tech. Lead

My blog : dotnetthoughts.net.
You can follow me in twitter : @anuraj

Comments and Discussions

 
-- There are no messages in this forum --