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.

Cannot install prereleased tool package from dotnet-install-tool without specifying the exact version

See original GitHub issue

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

cc @KathleenDollard

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:17
  • Comments:61 (35 by maintainers)

github_iconTop GitHub Comments

5reactions
yufeihcommented, Mar 4, 2019

What is the status of this issue? Installing latest pre-release tool is a badly needed scenario.

3reactions
nkolev92commented, May 3, 2018

That was bad formatting on my side.

The value is *-*.

And will mean: Give me the latest version & and I’m ok if that latest version is prerelease. So it would select 2.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot install prereleased tool package from dotnet- ...
To install a prerelease version of a CLI tool, users must know the exact version they want to install. This means they have...
Read more >
dotnet tool install command - .NET CLI
The dotnet tool install command installs the specified .NET tool on ... NET Core 3.1 SDK and later versions ... Include prerelease packages....
Read more >
How can 'nuget restore' download pre-release packages?
nuget.exe restore will download the exact version as specified in packages.config file. You will have to use update-package to update the ...
Read more >
Question - Can't see pre-release packages
I'm trying to instal the Pre-Release 5.0 version of AR Foundation but I can't get it to show in my package manager.
Read more >
Packaging and distributing projects
This section covers some additional details on configuring, packaging and distributing Python projects with setuptools that aren't covered by the introductory ...
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