-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Hot Reload unavailable #47836
Comments
This is a direct successor to #45519, which was closed with "Likely fixed by dotnet/sdk#31015.", but it was not fixed. I wish someone would have tested it with the provided example before deeming it "likely fixed". The test is very easy. Here's the minimal example, the same one that was provided in #45519, now upgraded to use SDK 7.0.302 szalapski/HotReloadIssue45519Demo Clone this and run
The site should start up. You'll see Please get Hot Reload to work reliably and consistently with Blazor WebAssembly (and Blazor Server, likely the same problem), especially with changes to .razor files. This feature seems so buggy when it should "just work". It seems to work much better with non-Blazor server-side changes, e.g. to a Web API, but that's not where much productivity benefit would result. When using
When running from VS (with or without debugging), I get similar output: See also:
Seems like there are a lot of others struggling too but not commenting in GitHub issues, e.g.
Expected Behavior
|
Adding @phil-allen-msft @maddymontaquila and @mcumming for visibility. |
I see this error in the browser with the latest .NET 8: Updated repro project:
|
@tmat I can repro that failure if I have VS Code editing the project (I have the C# Dev Kit installed). I get different results if I edit with Emacs or vim. In general
There's definitely something here. I'll try to get some more info |
@tmat yea, I don't see that Update |
This change will communicate the error message to dotnet-watch and print it out, for easier diagnostics in future: dotnet/sdk#33471 |
This should improve the "assembly cannot be edited or changed" error message dotnet/runtime#87880 |
@szalapski After these changes Hot Reload works. We certainly need to improve the error reporting. |
We use "Developer" for local machines and "Development" for a deployed dev environment. Is there any way to get it to work? The docs say that we can use any value we want for Environment so i'd hope there's a way. |
@szalapski Not currently, but fixing that: #48953 Meanwhile you may consider changing developer -> development and development -> deployed, or something like that. |
Thanks @tmat. I got rid of the notion of "Developer" in my demo app, instead using "Development", and I modified Program.cs accordingly, and I still see no change. I still get |
@szalapski I did. It works for me :-/ I had to remove |
Thanks, I just removed that package reference as well and pushed.
Hmm, I was afraid of that. I'm going to retry. I deleted my local repo and run exactly as follows
I got a lot of irrelevant info output, but after I edit Index.razor and save it, I get:
I have .NET SDK 7.0.302 running on Windows 10. @tmat What could be different in your run? What output do you see? |
Is there an existing issue for this?
Describe the bug
I am using the latest VS2022 17.6.0 Preview 4.0
The preview version created the BlazorServer project, and all hot reloads were invalidated without any prompt. I am unable to determine the reason
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
dotnet-sdk-7.0.203
Anything else?
No response
The text was updated successfully, but these errors were encountered: