-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Dotnet Watch Run indefinitely reloads #39073
Comments
I'm seeing the same thing for
Note that I am on macOS 12.0.1 with dotnet 6.0.1. |
Can confirm the same issue here (Windows 11, dotnet 6.0.101) |
Reproduced in a repl.it notebook: https://replit.com/@ripley/DotnetWatchRepro#README.md This seems like a pretty big bug in |
Just curious, is this an issue for everyone or is there something specific about our projects that are causing it? If the former, I would expect a lot more activity in this issue... unless there are not a lot of people using hot reload. |
In my experience, this only affects Console projects. Works as expected in Web Projects. Maybe there aren't many people doing |
I am running a Blazor project fwiw. |
Previous comment rescinded @mrlife . Consider it done. |
I can reproduce this by adding one line to a fresh Blazor Server project.
|
Could someone comment whether hot reload is supposed to work in a Blazor Server app? |
It does work but it takes 45 seconds to complete though. |
45 seconds... if you're lucky @CommonLoon102. :P I still have yet to see this feature work well or at all in my environment. |
@jamesikanos I can't reproduce this behavior with the 6.0.300 SDK. Are you still having issues? |
@mrlife are you still running into this problem with 6.0.300? If so, could you please file a separate issue with concrete details (a repro if possible) so that we can look at it? |
Hot reload should work with Blazor Server |
@mrlife If you do You will see that the issue is the process is failing to start:
And that's why there is a loop. |
@rgwood In your case the issue with your project is the TFM. It needs to be |
In general for folks running into this issue, stop dotnet watch and try to build the app with dotnet build or run it with dotnet run and if that fails, it's likely the issue to start with. |
I correct myself. netcoreapp6.0 works, but the issue is with |
Hi @javiercn, thank you for checking it out. Here is the new issue: #41776 |
Thanks @javiercn. Attempted to confirm the fix but it seems like I'm stuck on v6.0.105 until a newer SDK is published for Linux (on Fedora 36, installing via |
@rgwood It'll take some time until the fix is available. I proposed patching it, but it didn't make it into this month patch, so we are looking at July-ish for it to be released. If you want to verify the fix, you could clone the SDK repo. Run build.sh at the root and then eng\dogfood.sh That will setup the terminal with a local copy of the dotnet-sdk (including the fix) that contains a dotnet-watch version you can use against your project for validation. In general, my suggestion would be to try and run |
Describe the bug
Calling
dotnet watch run
will detect changes continuously and loop forever.The first time a file is changed, the Program will rebuild and run. But, after that it will continuously rebuild and reload, even without changing the file.
Workaround, run
dotnet watch run --no-hot-reload
and it will behave as desired (ie: only reloading when a file actually changes).Environment: WSL2
To Reproduce
dotnet new console
dotnet watch run
Observe that the program will constantly restart.
Exceptions (if any)
No exception
Further technical details
Running on VSCode. This behaviour is also observed when running
dotnet watch run
from Ubuntu terminal..NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.100/
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
2.1.816 [/usr/share/dotnet/sdk]
3.1.410 [/usr/share/dotnet/sdk]
6.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.28 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.28 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.16 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.28 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.16 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
The text was updated successfully, but these errors were encountered: