sdk: [8.0.100-rc.2.23469.4] some deprecated global tools get NuGetPackageNotFoundException when installing
Issue Description: When installing these global tools with “dotnet tool install” command, NuGetPackaeNotFoundException will be thrown on dotnet-sdk-8.0.100-rc.2.23469.4. But they are installed successful with dotnet-sdk-8.0.100-rc.2.23466.1.
Application Name: Elemental.SysInfoTool, dotnet-giio, dotnet-sqldb OS: Windows 10 21H2 CPU: X64 .NET Build Number: dotnet-sdk-8.0.100-rc.2.23469.4
Verify Scenarios:
- Windows10 21h2 x64 + dotnet-sdk-8.0.100-rc.2.23469.4: Fail
- Windows10 21h2 x64 + dotnet-sdk-8.0.100-rc.2.23466.1: Pass
Repro steps: The machine only has 8.0.100-rc.2.23469.4 installed and set DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX environment variable as 2.
- Open cmd.exe form %windir%\System32
- Input ‘dotnet tool install -g Elemental.SysInfoTool’
- Press keyboard ‘Enter’
Expected Result: Elemental.SysInfoTool install successful.
Actual Result: Install failed with following exception:
Unhandled exception: Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageNotFoundException: elemental.sysinfotool::[*, ) is not found in NuGet feeds https://api.nuget.org/v3/index.json, https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json, https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json, https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json, https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json, https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json, https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json, https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev, https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json, https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json, https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json, https://pkgs.dev.azure.com/dnceng/internal/_packaging/6.0.414-servicing.23416.29-shipping/nuget/v3/index.json".
at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.GetMatchingVersionInternalAsync(String packageIdentifier, IEnumerable`1 packageSources, VersionRange versionRange, CancellationToken cancellationToken)
at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.GetBestPackageVersionAsync(PackageId packageId, VersionRange versionRange, PackageSourceLocation packageSourceLocation)
at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.<>c__DisplayClass8_0.<InstallPackage>b__0()
at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback)
at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.Execute()
at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
Findings:
These tools do not exist in NuGet Gallery | Packages
And their details page marked them as deprecated and cannot be used anymore. For example, this is the Elemental.SysInfoTool tool page.
But we can install this tool successfully when we have earlier SDK installed in our machine.
This issue seems related to https://github.com/dotnet/sdk/commit/81140426e38ac2e3071c23ac5c66803d63e8aa7c
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 23 (16 by maintainers)
PR https://github.com/dotnet/sdk/pull/36671 was merged to the release/8.0.1xx branch in commit 5a7019c5acf54e2e8a91e2b64c342e5a7ffc0275, but it seems the
GetBestPackageVersionAsyncchange insrc/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cswas not correctly merged to the release/8.0.2xx branch in commit 7d995fce293917e817f63d0a41808dfc6779a034 (PR https://github.com/dotnet/sdk/pull/36874). Commit 6c74ad6e3c814f32538e9fd2ccfece683bf6bfbb in PR https://github.com/dotnet/sdk/pull/36641 to release/8.0.2xx had added a space inif (and caused a merge conflict that was resolved incorrectly.@Junjun-zhao A change that accept the bare version as NuGet exact version was merged
Maybe the brackets make sense in
dotnet add package; but I don’t think version ranges are useful indotnet tool install. There are no transitive references to .NET tool packages, so NuGet never has to choose a tool version that satisfies multiple constraints.Update: The unlist tool can be successfully installed when a version is specified and enclosed in square brackets(install the Exact version match). The above validation which just mentioned the version, actually it is a range (X >=Version) according to the document https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-basics
For example: dotnet tool install --global Elemental.SysInfoTool --version [0.5.0]
The only thing to need your kindly confirm is whether we will be creating a breaking document for this? @JL03-Yue @marcpopMSFT @KalleOlaviNiemitalo
I’m experiencing the same issue when restoring in Azure DevOps a project that references Microsoft Tye 0.11 since RC2 went live.
The same issue doesn’t happen on my local machine.
See for more details the issue on the Tye repo: https://github.com/dotnet/tye/issues/1615