1

I'm trying to run my web application in watch mode referring to How to watch for file changes "dotnet watch" with Visual Studio ASP.NET Core but in newer version (core 1.1.1) I can't find launchSettings.json file, so where put settings? I installed Microsoft.DotNet.Watcher.Tools but I don't have a button "watch" in Visual Studio.

Community
  • 1
  • 1

1 Answers1

1

You can find the launchSettings.json in the Solution Explorer under the menu Properties. There you can add the settings for your "watch" profile.

You can add following profile settings:

"Watch": {
    "executablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
    "commandLineArgs": "watch run",
    "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
    }
}

launchSettings.json in Solution Explorer

  • 1
    Did so. Getting the following in the console: `Using launch settings from System.ArgumentNullException: Value cannot be null. Parameter name: key at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary2.ContainsKey(TKey key) at Microsoft.DotNet.Tools.Run.LaunchSettings.LaunchSettingsManager.Try.... at Microsoft.DotNet.Cli.Program.Main(String[] args) watch : Exited with error code 1` – Bahaa Jan 04 '18 at 11:15