What is aspnetcore-browser-refresh.js and how can I stop VS 2022 from adding its own client side script

Petteys, Kevin 91 Reputation points
2022-09-14T14:29:05.71+00:00

What is aspnetcore-browser-refresh.js's purpose? How can I stop it from being deployed to my projects.

VS 2022 keeps adding client side scripts to my projects. I am spending a lot of time trying to debug them and prevent them from being pubished. I great example of this is the amount of effort it takes to disable Browser Link (no it does not disable just by clicking the disable button from VS's toolbar.) I am writing my own HTML JS front end and only using Web API for server calls. I am using Swagger UI but that is not VS either. Aspnetcore-browser-refresh.js is only being deployed with my static html file.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,134 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
935 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 47,711 Reputation points
    2022-09-14T14:55:18.657+00:00

    This is only while you're running in the debugger and should have no impact on your production code. It is for hot reloading. Since it should not be causing any issues with your app nor really be used outside debugging then I would leave it alone. However if you want to disable hot reloading refer to the docs here which discuss how to do it based upon how you're starting your app.