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 run watches the .git folder. #43817

Open
StringEpsilon opened this issue Oct 1, 2024 · 4 comments
Open

dotnet watch run watches the .git folder. #43817

StringEpsilon opened this issue Oct 1, 2024 · 4 comments
Labels
Area-Watch untriaged Request triage from a team member

Comments

@StringEpsilon
Copy link

Describe the bug

The dotnet watch run command watches the .git folder of my project, sometimes even recompiling due to this error:

Unable to apply hot reload, restart is needed to apply the changes.

From a simple git stash / git stash pop:

dotnet watch ⌚ Files added: ./.git/objects/3c/tmp_obj_S92RQS, ./.git/index.lock, ./.git/index, ./.git/objects/3c/82172b9f73e35b3b42e3653c719df4db9726ec
dotnet watch ⌚ Files added: ./.git/objects/3c/tmp_obj_S92RQS, ./.git/index.lock, ./.git/index, ./.git/objects/3c/82172b9f73e35b3b42e3653c719df4db9726ec
dotnet watch ⌚ No hot reload changes to apply.
Files added: ./.git/index.lock, ./.git/index, ./.git/AUTO_MERGE, ./test, ./.git/AUTO_MERGE.lock
dotnet watch ⌚ Files added: ./.git/index.lock, ./.git/index, ./.git/AUTO_MERGE, ./test, ./.git/AUTO_MERGE.lock
dotnet watch ⌚ No hot reload changes to apply.

To Reproduce

  1. Create a new test application in a new git repository where the .csproj file is located in the git root folder.
  2. touch test
  3. git add test
  4. dotnet watch run
  5. git stash -S

Now observe the dotnet watch console output.

Exceptions (if any)

N/A

Further technical details

  • dotnet --info output:
dotnet --info
	.NET SDK:
	Version:           9.0.100-rc.1.24452.12
	Commit:            81a714c6d3
	Workload version:  9.0.100-manifests.a7bf2b8f
	MSBuild version:   17.12.0-preview-24422-09+d17ec720d

Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/9.0.100-rc.1.24452.12/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 9.0.0-preview.7.24405.7
Architecture: x64
Commit: static

.NET SDKs installed:
6.0.133 [/usr/share/dotnet/sdk]
8.0.108 [/usr/share/dotnet/sdk]
9.0.100-rc.1.24452.12 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.33 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_ROOT [/usr/share/dotnet]

global.json file:
Not found

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch untriaged Request triage from a team member labels Oct 1, 2024
@MackinnonBuck MackinnonBuck added Area-Watch and removed Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch labels Oct 3, 2024
@MackinnonBuck
Copy link
Member

@tmat, looks like this is a dotnet watch issue.

@tmat
Copy link
Member

tmat commented Oct 3, 2024

@StringEpsilon Could you share the full --verbose output for the case when you get Unable to apply hot reload, restart is needed to apply the changes. error?

@StringEpsilon
Copy link
Author

StringEpsilon commented Oct 3, 2024

@tmat I have only had that happen once so far from changes in the .git directory, which was when I was testing the reproduction steps for this issue.

If I find a way to provoke that reliably, I'll try to get the verbose output for it. But I'll not run --verbose for my everyday work to catch what turned out to be a fluke, hope you'll understand.

The main issue still stands tho.

@tmat
Copy link
Member

tmat commented Oct 3, 2024

@StringEpsilon Thanks. We can certainly special-case and exclude the .git directory, but there should be no difference in functionality. Just more console output.

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

3 participants