How to monitor dotnet watch file changes with Visual Studio ASP.NET Core

I am using Visual Studio with an ASP.NET kernel and running a website using only F5 or Ctrl + F5 (not using the command line directly). I would like to use the "dotnet watch" functionality to make sure that all changes are selected on the fly to avoid restarting the server. It looks like with the command line you would use "hourly dotnet" work for this, but Visual Studio uses launchSettings.json and does it behind the scenes if I understand it correctly.

How can I connect the "dotnet watch"?

+5
source share
1 answer

Open launchSettings.json and add it to profiles .

  "Watch": { "executablePath": "C:\\Program Files\\dotnet\\dotnet.exe", "commandLineArgs": "watch run", "launchBrowser": true, "launchUrl": "http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } 

Open the project.json file and add it to tools .

 "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" 

After recovery, we can observe from Visual Studio.

enter image description here

+6
source

Source: https://habr.com/ru/post/1258533/


All Articles