Home > Net >  VS2022 Hot Reload unconditionally restarts application after changes
VS2022 Hot Reload unconditionally restarts application after changes

Time:02-10

for C# there's this option in VS for hot reloading, to automatically rebuild and restart the application. This is usually necessary when the changes couldn't be applied while the application was running. In practice, this happens a lot when you have a syntax error and press save. Unfortunately, I checked the option "always rebuild when changes can't be applied while running the application" (I don't remember the exact name of this option). So now, each time when I have a syntax error and accidentally save the file, it exits the application I'm debugging, while I could have easily fixed the syntax error and saved again, without restarting.

Is there a way to restore this setting such that the dialog pops up again, asking me whether I want to continue editing or restart the application? I believe this dialog is called "rude edit". I tried to find the option in the settings of Visual Studio, but could not find it. A work-around is to disable hot reloading on file save, and manually triggering the hot reload after I save a file, but I'd rather have the old behavior.

CodePudding user response:

  •  Tags:  
  • Related