Skip to content
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

Blazor WASM Hot Reload cli not working #38561

Closed
chhinsras opened this issue Nov 22, 2021 · 30 comments
Closed

Blazor WASM Hot Reload cli not working #38561

chhinsras opened this issue Nov 22, 2021 · 30 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-hot-reload This issue is related to the Hot Reload feaature ✔️ Resolution: Duplicate Resolved as a duplicate of another issue

Comments

@chhinsras
Copy link

chhinsras commented Nov 22, 2021

I have blazor hosted. I run dotnet watch inside server project. Only hot reload works for sever project not the client project.

I try to run dotnet watch inside project. It has hot reload on client project when I change file, and of course there is no server running.

@chhinsras Can you file a new issue specifically about your Blazor WASM + hot reload problem?

Originally posted by @captainsafia in #38103 (comment)

@chhinsras chhinsras changed the title @chhinsras Can you file a new issue specifically about your Blazor WASM + hot reload problem? Blazor WASM Hot Reload cli not working Nov 22, 2021
@TanayParikh TanayParikh added area-blazor Includes: Blazor, Razor Components area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-hot-reload This issue is related to the Hot Reload feaature labels Nov 22, 2021
@mkArtakMSFT
Copy link
Member

Thanks for contacting us. Can you please share more context about the scenario in this issue so that everyone who will be reading this won't need to go to the linked issue and get the details from there?

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Nov 22, 2021
@ghost
Copy link

ghost commented Nov 22, 2021

Hi @chhinsras. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@chhinsras
Copy link
Author

I have blazor hosted. I run dotnet watch inside server project. Only hot reload works for sever project not the client project.

I try to run dotnet watch inside project. It has hot reload on client project when I change file, and of course there is no server running.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Nov 24, 2021
@SteveSandersonMS
Copy link
Member

@pranavkm Does watch handle ASP.NET Core-hosted WebAssembly projects?

@pranavkm
Copy link
Contributor

It does. There is a (concurrency) issue with watch where it'll sometimes timeout and get incorrect hot reload capabilities for a Blazor WASM app, but in general, it should work.

@ziaulhasanhamim
Copy link

@pranavkm generally it doesn't work. once in a while it works.

@mkArtakMSFT
Copy link
Member

@pranavkm is this a dupe then of the linked issue?

@mkArtakMSFT mkArtakMSFT added this to the .NET 7 Planning milestone Nov 30, 2021
@ghost
Copy link

ghost commented Nov 30, 2021

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT mkArtakMSFT removed the Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. label Nov 30, 2021
@chhinsras
Copy link
Author

hahah. .NET 7. Why not addressing in upcoming patch

@ziaulhasanhamim
Copy link

1 year of waiting for these kinda bugs is hilarious

@Aquaritek
Copy link

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

And I'll raise another flag here too referring to the first thread I posted in about this same issue. I'm fairly certain there are 3 threads on this now. #38809 (comment)

@chhinsras
Copy link
Author

@Aquaritek I have been working with C# since 2015 and with Asp.Net since 2019. I really love them.

I started to adapt Blazor in 2020. I most of the time use VS code for development which I am on Mac. I started the company project with Asp.Net and Blazor early this year. Really struggling with development experienece and no reason bugs. Been almost a year, finally, It is hard but I have to move away from Blazor right now with the current development expereience.

Hope to be back in upcoming .NET7 with ready and user-friendly development expereience.

What I like using now is Asp.Net and Angular stacks. MAUI is interesting but I hesitate to compare with Flutter.

My suggestion, VS code should be priorized as well since it is Microsoft open source project, yet, the Flutter development on VS code is far-far better than MAUI or Blazor.

@ziaulhasanhamim
Copy link

@chhinsras I agree. CLI and vs code should be the absolute first choice for .net development. the .net platform should be CLI first for ultimate cross-platform development solution like any other platform such as js, node, go, flutter, python, etc. these all have great ide support. But they prioritize CLI most

@chhinsras
Copy link
Author

@chhinsras I agree. CLI and vs code should be the absolute first choice for .net development. the .net platform should be CLI first for ultimate cross-platform development solution like any other platform such as js, node, go, flutter, python, etc. these all have great ide support. But they prioritize CLI most

I love .net but yeah, I am really struggling. it's shameful that VS Code support Flutter much much better than Blazor , MAUI

@ziaulhasanhamim
Copy link

I love .net but yeah, I am really struggling. it's shameful that VS Code support Flutter much much better than Blazor , MAUI

yeah even go, rust support in vs code is increasing day by day. But I can't see much improvements in vs code omnisharp for c# extension.

@chhinsras
Copy link
Author

I love .net but yeah, I am really struggling. it's shameful that VS Code support Flutter much much better than Blazor , MAUI

yeah even go, rust support in vs code is increasing day by day. But I can't see much improvements in vs code omnisharp for c# extension.

I do not understand either. VS IDE is good, but I love VS Code than. Now Hot Reload CLI is planned for .NET7 which is another year to go.

I just found another bug inside VS code for C# 10 with .NET6.

Using implicit namespace. you will see differnt color of property inside Class.

@ziaulhasanhamim
Copy link

Yeah, there are quite some bugs. C# doesn't provide the ultimate coding experience with vs code like most other modern languages

@chhinsras
Copy link
Author

Yeah, there are quite some bugs. C# doesn't provide the ultimate coding experience with vs code like most other modern languages

It's so frustrating sometime! I like flutter more on its dev experience

@pranavkm
Copy link
Contributor

pranavkm commented Jan 7, 2022

@chhinsras do you happen to have a minimal app that reproduces the issue? I'm unable to reproduce the reported issue on a project created from the template.

@pranavkm pranavkm added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Jan 7, 2022
@ghost
Copy link

ghost commented Jan 7, 2022

Hi @chhinsras. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@chhinsras
Copy link
Author

@chhinsras do you happen to have a minimal app that reproduces the issue? I'm unable to reproduce the reported issue on a project created from the template.

Yes. Blazor WSAM hosted project.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Jan 10, 2022
@pranavkm
Copy link
Contributor

pranavkm commented Jan 11, 2022

@chhinsras can you run watch with the --verbose switch (dotnet watch --verbose), make a file change once the app is running and include the output?

@pranavkm pranavkm added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Jan 11, 2022
@ghost
Copy link

ghost commented Jan 11, 2022

Hi @chhinsras. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ziaulhasanhamim
Copy link

@pranavkm i was facing the same issue.

watch : Project supports hot reload and was configured to run with the default run-command. Watching with hot-reload
watch : Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. Press "Ctrl + R" to restart.
watch : Building...
watch : Started 'C:\Program Files\dotnet\dotnet.exe' '' with process id 11308
  Determining projects to restore...
  All projects are up-to-date for restore.
  BlazorWasm -> C:\Users\ziaul\BlazorWasm\bin\Debug\net6.0\BlazorWasm.dll
  BlazorWasm (Blazor output) -> C:\Users\ziaul\BlazorWasm\bin\Debug\net6.0\wwwroot
watch : Process id 11308 ran for 10074ms
watch : Running MSBuild target 'GenerateWatchList' on 'C:\Users\ziaul\BlazorWasm\BlazorWasm.csproj'
watch : Started 'C:\Program Files\dotnet\dotnet.exe' '' with process id 8312
watch : Process id 8312 ran for 1342ms
watch : Watching 28 file(s) for changes
watch : dotnet-watch is configured to launch a browser on ASP.NET Core application startup.
watch : Configuring the app to use browser-refresh middleware.
watch : Refresh server running at wss://localhost:60157,ws://localhost:60158.
watch : HotReloadProfile: BlazorWebAssembly.
watch : Waiting for a browser to connect
watch : Started 'dotnet' '"C:\Users\ziaul\.nuget\packages\microsoft.aspnetcore.components.webassembly.devserver\6.0.1\build\../tools/blazor-devserver.dll" --applicationpath "C:\Users\ziaul\BlazorWasm\bin\Debug\net6.0\BlazorWasm.dll"' with process id 12684
watch : Running dotnet with the following arguments: run
watch : Started
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:7179
watch : Launching browser.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5013
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\ziaul\BlazorWasm
watch : Hot reload capabilities: .
watch : File changed: C:\Users\ziaul\BlazorWasm\Pages\Index.razor.
watch : No deltas modified. Applying changes to clear diagnostics.
watch : Received 1 from browser in [Count: 1, MessageType: Binary, EndOfMessage: True].
watch : No hot reload changes to apply.
watch : Hot reload change handled in 2993.5768ms.

@pranavkm
Copy link
Contributor

@ziaulhasanhamim thanks for the logs. The log indicates a dupe of #36723 which is being addressed in the the upcoming .NET 6.0 SDK / VS 17.1 release. You could try a nightly build of the SDK from: https://github.com/dotnet/installer#installers-and-binaries (use an installer from the Release/6.0.2XX column).

@ziaulhasanhamim
Copy link

thanks for letting me know

@ghost
Copy link

ghost commented Jan 17, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Jan 20, 2022
@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Jan 28, 2022
@mkArtakMSFT mkArtakMSFT added Status: No Recent Activity and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: Resolved labels Jan 28, 2022
@szalapski
Copy link

szalapski commented Feb 24, 2022

This seems not to be fixed in SDK 6.0.200--when I change the plain HTML markup in a .razor file, I still get:

watch : File changed: C:\...\MyComponent.razor.
watch : No hot reload changes to apply.

With --verbose, I get:

watch : File changed: C:\...\MyComponent.razor.
watch : No deltas modified. Applying changes to clear diagnostics.
watch : Received 1 from browser in [Count: 1, MessageType: Binary, EndOfMessage: True].
watch : No hot reload changes to apply.
watch : Hot reload change handled in 5902.7638ms.

Can anyone help? It is so close to working!

@ziaulhasanhamim
Copy link

Having the same problem with SDK 6.0.200

watch : Hot reload capabilities: .

@ziaulhasanhamim
Copy link

@pranavkm

@ghost ghost locked as resolved and limited conversation to collaborators Mar 29, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-hot-reload This issue is related to the Hot Reload feaature ✔️ Resolution: Duplicate Resolved as a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

8 participants