-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dotnet watch hot reloads for all non-code files - potential infinite reload loop #44910
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
Comments
I had similar issue to exclude some directory from dotnet watch but it didn't work |
This is frustrating, particularly with webpack hot reload + emit files, where every time you save a js file, it emits hot reload chunk + json, which are added to the watch. It really slows down the reload after a couple of file changes and hogs CPU 😬 |
I'm still not using .NET 9, 3 months after its release, because of this issue. I tried 9.0.102, which did not resolve the problem. |
I'm considering every day if it is not worth it to downgrade back to .NET 8 every time the dotnet watch has some issue. |
4 months after release and I'm still using .NET 8 because of this issue. |
Starting with 9.0.200 dotnet-watch ignores files in output directories (bin, obj) and in directories starting with Further customization of ignored files is tracked by issue #45539.
We do not know whether other files that are being added have anything to do with building until we evaluate the project. |
The issue is dotnet watch now watches a lot more than it used to. It feels much more like opt-out configuration is required than opt-in. Since the opt-out configuration does not work today I cannot use dotnet watch in .NET 9. |
@seangwright I'm not sure I understand why dotnet-watch reporting "No hot reload changes to apply" is a blocker. Could you elaborate? |
I can't speak for the OP, but dotnet watch in 9.0 is Of course, 'A' might not be related to 'B' but to those of us outside the black box it seems reasonable to feel that there might be a connection. |
@willdean Is that only in scenarios where there are file writes to directories under the project directory other than obj/bin? What is an example of irrelevant file change? |
@tmat Did you take a look at my reproduction in my original post? I work with web apps that generate files in the file system while running. Each time this happens the web page reloads/refreshes from None of this was a problem in .NET 8. |
@seangwright |
I'm seeing this for the .db-journal file after editing any records in a sqlite database stored within the same directory as the code |
Related, dotnet watch is significantly slower when editing files with Rider vs VSCode, around 3x slower. Workaround is to disable Created a separate issue to track slow hot reload with temporary backup files: |
I found the same issue on .NET 9 as well. |
@tmat I'm assuming this won't be fixed for .NET 9 (which I've basically skipped using). Will this be fixed for .NET 10? |
@seangwright Will try but can't make promises. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I'm running
dotnet watch
in the directory of an ASP.NET Core 8.0 application using the .NET 9 SDK.My app generates non-code files in the
~\App_Data
directory as part of a background process (this includes binary, xml, json, and other non code files). When this happens,dotnet watch
records the files being created or modified and will even hot reloadFor example
I have tried ignoring specific files but none of the recommendations work. Even if they did work, there's no reason I should have to explicitly ignore some
.txt
files inApp_Data
to keep my app from reloading.To Reproduce
dotnet watch
App_Data\Test
becausedotnet watch
keeps reloading the pageExceptions (if any)
dotnet watch
should not process files that have nothing to do with rebuilding or hot-reloading my .NET application.Further technical details
This bug negatively impacts any project that generates files in the project during runtime - ASPNET Core apps with client assets, files uploaded/imported to the file system, log files, ect...
The text was updated successfully, but these errors were encountered: