dotnet tool update - error: Sequence contains more than one matching element
See original GitHub issueTrying 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:
- Created 4 years ago
- Comments:10 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@wli3 can you take a look?