0

It's not work to set launch.json commandLineArgs watch run in visual studio 4.8.03752.

my launch.json :

{
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "profiles": {
    "WebApplication23": {
      "commandName": "Project",
      "launchBrowser": false,
      "commandLineArgs": "watch run",
      "launchUrl": "weatherforecast",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

my visual studio version :

image-20200730170402853

I edited some code when program running but system show Warning ENC1003 Changes made in project 'WebApplication23' will not be applied while the application is running,system didn't rebuild code.

image-20200730170631827

I've tried below page's method but it also not work

Wei Lin
  • 3,591
  • 2
  • 20
  • 52

1 Answers1

1

according : dnx - How to watch for file changes "dotnet watch" with Visual Studio ASP.NET Core - Stack Overflow

ASP.NET 2.x or 3.x need to change to below json.

{
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "profiles": {
    "Watch": {
      "executablePath": "dotnet.exe",
      "workingDirectory": "$(ProjectDir)",
      "commandLineArgs": "watch run",
      "launchBrowser": true,
      "launchUrl": "http://localhost:5000/",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

and system will rebuild code :
image-20200730181559434

Wei Lin
  • 3,591
  • 2
  • 20
  • 52