21 November 2024

Live coding with using dotnet watch

I just discovered a little trick that will save you time debugging. It’s the use of dotnet watch. It’s not new, but it’s still necessary to know it… 😉

What is dotnet watch

dotnet watch is a tool that runs a .NET Core CLI command when source files change ; Basically as soon as we record. In fact, the one we’re going to associate will be run ! => we’re going to execute our project every time we save our jobs.

dotnet watch run

Personally, this feature will save me time when I develop my Blazor project.

Visual Studio 2019 (preview)

In the next version of Visual Studio, you will be able to directly open a Powershell window from the menu DISPLAY (CTRL+~)

Nothing like a little demonstration:

As you may have seen, you must first position yourself in our project folder before running dotnet watch run. And then just reload the page in the browser.

Leave a Reply