Debugging while using dotnet watch

480 views Asked by At

I have a problem with settings the correct launchsettings to enable both hotreload and debugging at the same time, having the following profile works fine with tracking required cshtml changes but disable all breakpoints, however changing the commandName to Project enable the breakpoints again but doesnt reload or track any changes

"Watch": { "commandName": "Executable", "executablePath": "dotnet", "commandLineArgs": "watch run", "launchBrowser": true, "hotReloadEnabled": true, "dotnetRunMessages": true, "nativeDebugging": true, "workingDirectory": "$(ProjectDir)", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "https://localhost:7092;http://localhost:5215" }

I am using .Net 7, Web Application, Output type is Console App

being Able to track cshtml changes and debug

Update I am using VS 2022 Community Edition

1

There are 1 answers

1
Ashraf ELHakim On BEST ANSWER

I have found this profile works fine with both track changes in cshtml and debugging using breakpoint

"profiles": {
  "IIS Express": {
    "commandName": "IISExpress",
    "launchBrowser": true,
    "environmentVariables": {
      "ASPNETCORE_ENVIRONMENT": "Development"
    }
  }
},
"iisSettings": {
  "windowsAuthentication": false,
  "anonymousAuthentication": true,
  "iisExpress": {
    "applicationUrl": "http://localhost:3853",
    "sslPort": 44376
  }
}