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 crashes upon adding static files #45183

Open
tanveerbadar opened this issue Nov 27, 2024 · 2 comments
Open

dotnet watch crashes upon adding static files #45183

tanveerbadar opened this issue Nov 27, 2024 · 2 comments
Labels
Area-Watch untriaged Request triage from a team member

Comments

@tanveerbadar
Copy link

Describe the bug

I am repeatedly seeing crashes in dotnet watch when my process adds any static file to its sub-directories that dotnet watch is listening for file change events.

To Reproduce

Start dotnet watch on a project which writes text file to one of the sub-directories. The process will crash.

Exceptions (if any)

dotnet watch ⏳ Waiting for a file to change before restarting dotnet...
dotnet watch 🔄 Restart requested.
dotnet watch ❌ System.ArgumentNullException: Value cannot be null. (Parameter 'key')
at System.Collections.Generic.Dictionary2.FindValue(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
at Microsoft.DotNet.Watcher.Tools.StaticFileHandler.HandleFileChangesAsync(IReadOnlyList`1 files, CancellationToken cancellationToken)
at Microsoft.DotNet.Watcher.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watcher.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watcher.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watcher.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watcher.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watcher.Program.RunAsync()
dotnet watch ❌ An unexpected error occurred

Further technical details

Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.13.0 Preview 1.0

PS > dotnet --info
.NET SDK:
Version: 9.0.100-rc.2.24474.11
Commit: 315e130
Workload version: 9.0.100-manifests.4872d5d5
MSBuild version: 17.12.0-preview-24473-03+fea15fbd1

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-rc.2.24474.11\

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

Host:
Version: 9.0.0-rc.2.24473.5
Architecture: x64
Commit: 990ebf52fc

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

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.35 [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.10 [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-rc.2.24474.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.35 [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.10 [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-rc.2.24473.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.35 [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.10 [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-rc.2.24474.4 [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:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Watch untriaged Request triage from a team member labels Nov 27, 2024
@seangwright
Copy link

Maybe this is related to my issue #44910 🤔?

@OnurGumus
Copy link

OnurGumus commented Dec 14, 2024

Having the same issue.

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