-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 falls over frequently with "An item with the same key has already been added" #45455
Comments
I also see this warning in the Command Prompt: dotnet watch ⚠ msbuild: [Warning] Found project reference without a matching metadata reference: C:\xxx\yyy\zzz\aaa\Language.csproj dotnet watch ⏳ Waiting for a file to change before restarting dotnet... I don't know if the warning is related to the error in the subject of this Issue, or if the "waiting for file to change" problem is related to the warning (but it only appears after the warning occurs) |
Also noticing this when pressing Ctrl+R to reload in the CLI. I am running an api and Blazor site simultaneously via 'dotnet watch' but wasn't a problem in .NET 8 |
This may not be restricted to dotnet watch in the command line. I also get Hot Reload build failures when running via Visual Studio. |
Like @jofford, we are also have a Blazor (Wasm) project and an ASP.Net Core API project (which references the Blazor project) |
Also having this annoying issue, doing random stuff with the projects causes the watch to just crash |
Me too;
Then dotnet watch crashes out. This is worse than previous version which was also really flakey (sigh) |
@tmat should this move to dotnet/sdk? |
Possible temporary solution is using previous dotnet version. It can be done by adding global.json file in your projects folder with previous working dotnet version:
|
Anyone has a project they can share where this issue reproduces? |
Happening with my Maui hybrid app. In fact, it happened very early on and I just got used to recompiling everytime. I will try creating a project using the basic template from visual studio and see if it happens without any changes. (Tomorrow morning unless someone beats me to it.)
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Tomáš Matoušek ***@***.***>
Sent: Tuesday, December 17, 2024 6:47:47 PM
To: dotnet/sdk ***@***.***>
Cc: Lee McPherson ***@***.***>; Manual ***@***.***>
Subject: Re: [dotnet/sdk] Dotnet watch falls over frequently with "An item with the same key has already been added" (Issue #45455)
Anyone has a project they can share where this issue reproduces?
—
Reply to this email directly, view it on GitHub<#45455 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB3VQSAFAH6U6BTXLW5WM6L2GDO5HAVCNFSM6AAAAABTSKFC5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJQGE4TEMZWGY>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Attaching a small sample project that has the error. It seems to be caused by a class library which targets multiple frameworks.BlazorWasmApp.zip Steps to reproduce:
Here's what showed up when I ran it with
|
Fixed by #45602 |
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
The text was updated successfully, but these errors were encountered: