Some time ago, a Visual Studio update added a hot reload feature. It be handy, but it also can be annoying especially when you're testing and you don't want to reset the current state of the front end. Visual Studio injects the script whether you're debugging or not.
How can hot reload be disabled? My Visual Studio version is 16.10.3
https://devblogs.microsoft.com/visualstudio/speed-up-your-dotnet-and-cplusplus-development-with-hot-reload-in-visual-studio-2022/
You can change this feature here:
Tools > Options > Projects and Solutions > ASP.NET Core > Auto build and refresh option
Options to automatically build and refresh the browser if the web server is running when changes are made to the project.
Your options in this dropdown are the following:
Also note my version of VS is 16.11.1
.
in VS 2022 open launchSettings.json in the Properties folder
find your profile and add (see arrow, don't add arrow)
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"Gang.Bingo.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:7249;http://localhost:5249",
"dotnetRunMessages": true,
"hotReloadEnabled": false <===========
}
}
}```
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With