Is there an existing issue for this?
Describe the bug
Since upgrading our ASP.Net Core projects to .Net 9 (but leaving the others alone for now), we are experiencing the following error when running dotnet watch:
dotnet watch ❌ System.ArgumentException: An item with the same key has already been added. Key:
C:\xxx\yyy\zzz\aaa\Language.csproj
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at Microsoft.DotNet.Watcher.Tools.IncrementalMSBuildWorkspace.UpdateProjectConeAsync(String rootProjectPath, 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
Language.csproj is a an assembly containing resource files.
Dotnet watch falls over at this point. It happens very frequently, making Hot Reload impossible.
Expected Behavior
Dotnet watch runs without failure
Steps To Reproduce
No response
Exceptions (if any)
System.ArgumentException: An item with the same key has already been added
.NET Version
9.0
Anything else?
This did not happen in .Net 8
Is there an existing issue for this?
Describe the bug
Since upgrading our ASP.Net Core projects to .Net 9 (but leaving the others alone for now), we are experiencing the following error when running dotnet watch:
Language.csproj is a an assembly containing resource files.
Dotnet watch falls over at this point. It happens very frequently, making Hot Reload impossible.
Expected Behavior
Dotnet watch runs without failure
Steps To Reproduce
No response
Exceptions (if any)
System.ArgumentException: An item with the same key has already been added
.NET Version
9.0
Anything else?
This did not happen in .Net 8