-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
To install a prerelease version of a CLI tool, users must know the exact version they want to install. This means they have to open a browser to nuget.org or myget.org to find the package.
For example, this is the console output for dotnet-watch
> dotnet install tool --global dotnet-watch --source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
Install failed. Failed to download package:
NuGet returned:
Failed to restore package.
WorkingDirectory:
Arguments: restore C:\Users\namc\AppData\Local\Temp\0rc552nv.kmy\wjh4elju.lgh.csproj --source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json --runtime win10-x64 /p:BaseIntermediateOutputPath=\"C:\Users\namc\.dotnet\tools\dotnet-watch\gx5ifack.dyr\"
Output: Restoring packages for C:\Users\namc\AppData\Local\Temp\0rc552nv.kmy\wjh4elju.lgh.csproj...
C:\Users\namc\AppData\Local\Temp\0rc552nv.kmy\wjh4elju.lgh.csproj : error NU1103: Unable to find a stable package dotnet-watch with version
C:\Users\namc\AppData\Local\Temp\0rc552nv.kmy\wjh4elju.lgh.csproj : error NU1103: - Found 124 version(s) in https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json [ Nearest version: 2.1.0-preview1-27934 ]
C:\Users\namc\AppData\Local\Temp\0rc552nv.kmy\wjh4elju.lgh.csproj : error NU1103: - Found 1 version(s) in C:\Users\namc\.dotnet\x64\sdk\NuGetFallbackFolder [ Nearest version: 2.1.0-preview1-28124 ]
Restore failed in 680.98 ms for C:\Users\namc\AppData\Local\Temp\0rc552nv.kmy\wjh4elju.lgh.csproj.
Usage: dotnet install tool [options] <PACKAGE_ID>
Arguments:
<PACKAGE_ID> NuGet Package Id of the tool to install.
Options:
-g, --global Install user wide.
--version Version of the tool package in NuGet.
--configfile The NuGet configuration file to use.
--source <SOURCE> Specifies a NuGet package source to use during installation.
-f, --framework The target framework to install the tool for.
-h, --help Show help information.
This is the console output when trying to specify --version 2.1.0-*
> dotnet install tool --global dotnet-watch --version 2.1.0-* --source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
System.ArgumentException: Illegal characters in path.
Parameter name: path
at System.IO.Path.GetFullPath(String path)
at System.IO.Directory.CreateDirectory(String path)
at Microsoft.DotNet.ToolPackage.ToolPackageObtainer.EnsureDirectoryExists(DirectoryPath path)
at Microsoft.DotNet.ToolPackage.ToolPackageObtainer.CreateIndividualToolVersionDirectory(String packageId, PackageVersion packageVersion)
at Microsoft.DotNet.ToolPackage.ToolPackageObtainer.ObtainAndReturnExecutablePath(String packageId, String packageVersion, Nullable`1 nugetconfig, String targetframework, String source)
at Microsoft.DotNet.Tools.Install.Tool.InstallToolCommand.ObtainPackage(DirectoryPath executablePackagePath, DirectoryPath offlineFeedPath)
at Microsoft.DotNet.Tools.Install.Tool.InstallToolCommand.Execute()
at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args)
at Microsoft.DotNet.Tools.Install.InstallCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Ideas
- Support wildcards
--version 2.1.0-*
- Support a
--prerelease
flag
jmp75, sanisoclem, psmolkin, mingwli, AArnott and 13 more