question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet tool update - error: Sequence contains more than one matching element

See original GitHub issue

Trying to run: dotnet tool update --global <name of internal Nuget hosted in Azure DevOps artifacts>

Works perfectly running locally, but when run on our build servers (self hosted pool) in Azure DevOps, we sometimes get this error:

Sequence contains more than one matching element
at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.DotNet.ToolPackage.ToolPackageInstance.FindLibraryInLockFile(LockFile lockFile, PackageId id)

Same error when using: dotnet tool install

Any idea what is causing this exception? - can’t debug and the error message is really not that helpful.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
pksorensencommented, Apr 14, 2020

I found out that the problem was due to having a variable: RuntimeIdentifier in my yaml file caused this to blow up, changing my variable name the problem did go away.

So maybe build agents sets environment variables that blow up dotnet tools install.

1reaction
livarcocccommented, Oct 29, 2019

@wli3 can you take a look?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Entity Framework | Sequence contains more than one ...
You have net6.0 target framework which is still not released while you have installed EF6 which is a previous iteration Entity Framework ...
Read more >
.Net 6 Upgrade - Microsoft Q&A
EnumerableMethods' threw an exception.' InvalidOperationException: Sequence contains more than one matching element. We have used a few ...
Read more >
Sequence contains more than one matching element
It generally works great, however, if there is more than one model with the same model name, the form fails with the error....
Read more >
"Sequence contains more than one matching element" error ...
Hello @petercli ,. Welcome to the community! It seems like you are using an old .NET ms build scanner which is no longer...
Read more >
error sequence contains more than one matching element
After upgrading from 7.3.4 to Umbraco 7.3.8, I am now getting an error on particular nodes: Failed to retrieve data for content id...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found