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.

SDK with net5.0 change fails to restore dotnet repo tools

See original GitHub issue

See https://github.com/dotnet/runtime/issues/33837#issue-584775006 for more details

Microsoft.DotNet.ToolPackage.ResolverCacheInconsistentException: more than one row for coverlet.console-1.7.0-net5.0-any-coverlet
   at Microsoft.DotNet.ToolPackage.LocalToolsResolverCache.TryGetMatchingRestoredCommand(RestoredCommandIdentifier restoredCommandIdentifier, CacheRow[] cacheTable, RestoredCommand& restoredCommandList)
   at Microsoft.DotNet.ToolPackage.LocalToolsResolverCache.TryLoad(RestoredCommandIdentifier restoredCommandIdentifier, RestoredCommand& restoredCommand)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.PackageHasBeenRestored(ToolManifestPackage package, String targetFramework)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.InstallPackages(ToolManifestPackage package, Nullable`1 configFile)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.<>c__DisplayClass11_0.<Execute>b__0(ToolManifestPackage package)
   at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
   at System.Linq.ParallelEnumerable.ToList[TSource](ParallelQuery`1 source)
   at System.Linq.ParallelEnumerable.ToArray[TSource](ParallelQuery`1 source)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.Execute()
   at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args)
   at Microsoft.DotNet.Tools.Tool.ToolCommand.Run(String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)

cc @dsplaisted @rrelyea @wli3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
wli3commented, Mar 21, 2020

The repro is:

run tool restore with 5.0.0-preview3 run tool restore with 5.0.0-preview1 run tool restore with 5.0.0-preview3

Here is what happens. first restore cache add line: {“Version”:“1.7.0”,“TargetFramework”:“net5.0”,“RuntimeIdentifier”:“any”,“Name”:“coverlet”,“Runner”:“dotnet”,“PathToExecutable”:“C:\Users\wul\.nuget\packages\coverlet.console\1.7.0\tools/netcoreapp2.2/any/coverlet.console.dll”}

second restore, since preview 1 don’t know what is net5.0, an extra cache line is added {“Version”:“1.7.0”,“TargetFramework”:“netcore5.0”,“RuntimeIdentifier”:“any”,“Name”:“coverlet”,“Runner”:“dotnet”,“PathToExecutable”:“C:\Users\wul\.nuget\packages\coverlet.console\1.7.0\tools/netcoreapp2.2/any/coverlet.console.dll”}

3rd restore, preview 3 knows netcore5.0 == net5.0, so the select query get more than one result. And it errors out since this should not happen.

This error is a special case that only happens once when we rename netcore5.0 to net5.0. And we don’t have back compact requirement between previews. I suggest no product fix. Instead we should override DOTNET_CLI_HOME to ensure no shared state between CI runs. @ViktorHofer

1reaction
ViktorHofercommented, Mar 20, 2020

@wli3 I’m unsure if we really clean the %userprofile% directory for every CI run. I believe we should definitely set DOTNET_CLI_HOME to a temporary location for CI runs and I assumed we already do.

@Chrisboh @MattGal are we cleaning the %userprofile% (more precisely the %userprofile%.nuget) directory for every CI run or is that cached?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CI builds failing with restore error #33837 - dotnet/runtime
Looks like all our official builds are failing with the following restore ... SDK with net5.0 change fails to restore dotnet repo tools...
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
In this case, run msbuild -t:restore followed by msbuild , or use dotnet build (which restores packages automatically).
Read more >
Microsoft Visual Studio 2019: The project file cannot be ...
Try to edit environment Variables. Right click on This PC -> Properties -> Advanced System Settings -> Advanced -> Environment Variables ...
Read more >
Trying to use .NET Core. Tool installs failing because of . ...
I have uninstalled all .NET Framework SDKs/Runtimes. I have installed the latest .NET 5.0 SDK which includes the runtimes. I made a new...
Read more >
Dotnet build quiet. 18. In this article. For more information, see ...
NET has a set of command-line tools that are excellent. ... Why is my build, publish, or test step failing to restore packages?...
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