You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rerunning 'dotnet add package ...' creates duplicate in non-SDK #8561
yes, this repros with .net core 3.0.0-preview9 (and maybe 2.x? 1.x?)
whether you specify a version or not, it adds a new entry (even if you choose the same version).
Note...the new tag also seems to add with an attribute...which isn't legal in old csproj files - project system doesn't support it.
Would love to understand if this works with 2.x or 1.x.
Would be more interested in fixing sooner if it was a regression...but my guess is that this has always been broken...
Just come across this issue with a web project. I assume the only workaround right now is to ALWAYS do dotnet remove package first, then dotnet add package?
Just come across this issue with a web project. I assume the only workaround right now is to ALWAYS do dotnet remove package first, then dotnet add package?
Team triage meeting: non-SDK projects are not intended to be supported by the dotnet cli. We should check if there's an easy way for us to detect if the project is SDK or not, and error out, rather than adding a duplicate (probably less effort than actually fixing the issue)
Activity
rrelyea commentedon Sep 17, 2019
yes, this repros with .net core 3.0.0-preview9 (and maybe 2.x? 1.x?)
whether you specify a version or not, it adds a new entry (even if you choose the same version).
Note...the new tag also seems to add with an attribute...which isn't legal in old csproj files - project system doesn't support it.
Would love to understand if this works with 2.x or 1.x.
Would be more interested in fixing sooner if it was a regression...but my guess is that this has always been broken...
PeteBoyRocket commentedon Mar 20, 2020
Just come across this issue with a web project. I assume the only workaround right now is to ALWAYS do
dotnet remove packagefirst, thendotnet add package?Saibamen commentedon May 24, 2022
This is probably the only workaround
zivkan commentedon May 26, 2022
Team triage meeting: non-SDK projects are not intended to be supported by the dotnet cli. We should check if there's an easy way for us to detect if the project is SDK or not, and error out, rather than adding a duplicate (probably less effort than actually fixing the issue)
Saibamen commentedon May 27, 2022
Error?
What about currently used scripts in CI pipelines?
Please make it as warning.