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

dotnet watch hot reloads for all non-code files - potential infinite reload loop #44910

Open
seangwright opened this issue Nov 16, 2024 · 0 comments
Labels
Area-Watch untriaged Request triage from a team member

Comments

@seangwright
Copy link

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 reload

For example

dotnet watch ⌚ Files added: .\App_Data\LuceneSearch\QANDA_SEARCH\i-g0000059-p_False\write.lock, .\App_Data\LuceneSearch\QANDA_SEARCH\i-g0000059-p_False_taxonomy\write.lock
dotnet watch ⌚ Files added: .\App_Data\LuceneSearch\QANDA_SEARCH\i-g0000059-p_False\write.lock, .\App_Data\LuceneSearch\QANDA_SEARCH\i-g0000059-p_False_taxonomy\write.lock
dotnet watch ⌚ No hot reload changes to apply.

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 in App_Data to keep my app from reloading.

To Reproduce

  1. Clone https://github.com/seangwright/dotnet-watch-dotnet-sdk9-bug
  2. Run dotnet watch
  3. See home page load in browser
  4. See infinite number of .txt files created in App_Data\Test because dotnet watch keeps reloading the page

Exceptions (if any)

dotnet watch should not process files that have nothing to do with rebuilding or hot-reloading my .NET application.

Further technical details

.NET SDK:
 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.c6f19616
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100\

.NET workloads installed:
 [aspire]
   Installation Source: VS 17.12.35506.116
   Manifest Version:    8.2.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
   Install Type:              Msi

Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  8.0.404 [C:\Program Files\dotnet\sdk]
  9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  E:\workspace\dotnet\ASPNETMVC8_NET9SDK\global.json
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Watch untriaged Request triage from a team member labels Nov 16, 2024
@seangwright seangwright changed the title dotnet watch records new non-code files added under App_Data dotnet watch records new non-code files Nov 16, 2024
@seangwright seangwright changed the title dotnet watch records new non-code files dotnet watch hot reloads for all non-code files - potential infinite reload loop Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Watch untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant