-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support disabling auto-injection of browser refresh JavaScript via launch profile property #44805
Comments
This is also needed when using front end frameworks which have their own HMR. |
I would also add that this should work in mixed environments where you have blazor on the page that you want to hot reload and you have a razor page that you want the server side rendering to reload separately Currently the script
|
While not perfect, you can already disable the middleware responsible for injecting the JavaScript by using the |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for contacting us. We're moving this issue to the |
As a result of the problems experienced by some customers in their ASP.NET Core apps when the browser refresh script is auto-injected, as detailed in #32767, I’m proposing that we add a new launch settings/profile property that can be used to disable the automatic injection of the browser refresh script.
The property would be named
disableBrowserRefreshScriptInjection
and would default tofalse
. Setting this property totrue
in a launch profile inlaunchSettings.json
would preventdotnet watch
and Visual Studio from injecting the middleware that writes out the browser refresh JavaScript to HTML responses from the app, e.g.:Note that this setting should not disable any other part of the mechanism that enables browser refreshing on Hot Reload, project build, CSS file change, etc., so that the app can manually add the required JavaScript reference manually, e.g.
The text was updated successfully, but these errors were encountered: