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
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.
This isn't a great solution, but it's a viable workaround.
In the "Network" tab of Chromium Edge's developer tools, I found the request to load aspnetcore-browser-refresh.js. I right click on it and selected "Block URL". This prevents the script from loading.