Writing HTML via BodyWriter is broken when VS.NET "Refresh browser after build" is on. #48897
Closed
1 task done
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
feature-hot-reload
This issue is related to the Hot Reload feaature
investigate
Milestone
Is there an existing issue for this?
Describe the bug
HTML Responses written via HttpContext.Response.BodyWriter fail (returning empty content) when the asp.net core application is started from VS.NET and the VS.NET option "Projects and Solutions > ASP.NET Core > General > Auto build and refresh" is set to "Refresh browser on build".
This is easily triggered in various configurations, but for example, the following code derived from the ASP.NET core Web API template will trigger it:
Initial analysis shows that something somewhere is trying to inject a script tag referring to
aspnetcore-browser-refresh.js
. I'm not sure why this results in the response received by the browser being empty.I tried to find an existing issue for this behavior, and found the following possibly related but non-identical issues:
Expected Behavior
Loading
/html
of the provided sample in a browser displays a page containingHello, world!
, even when the web server is started directly from VS.NET. Alternatively, if some configuration combination cannot be supported, I'd expect an exception to be thrown and/or a message to be logged somewhere visible.Steps To Reproduce
Exceptions (if any)
No response
.NET Version
7.0.304
Anything else?
Reproducible with both VS.NET Version 17.7.0 Preview 2.0 and Version 17.6.3
The text was updated successfully, but these errors were encountered: