dotnet / dotnet/sdk

Improve experience In dnx/dotnet tool exec when there are no non-preview tool packages available

Open
#49,815 1 comment 2 reactions 1 assignee Claimed by @dsplaisted View on GitHub
Area-Tools new-hire-issue
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

If you try to use `dnx` or `dotnet tool exec` to run a tool which has no stable package versions, the .NET CLI will report that the package is not found:

```
> dnx Microsoft.Crank.Agent
microsoft.crank.agent is not found in NuGet feeds https://api.nuget.org/v3/index.json, https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\, C:\Program Files\DevExpress 24.1\Components\System\Components\Packages.
```

We should have a better experience here. Probably, if we can't find the tool package and `--prerelease` wasn't specified, then we should check to see if there are any prerelease versions of the package available. If there are, then:

- If `--yes` was specified, then we should use the latest prerelease version of the package
- If we're in interactive mode, then we should print a message saying something like: `No stable versions of 'Microsoft.Crank.Agent' were found. Would you like to run the latest prerelease version of the package (0.2.0-alpha.25128.2)?` If the user answers yes, then we can skip the confirmation prompt to download the tool if it's not already in the global packages folder.
- If we're not in interactive mode, print an error message such as `No stable versions of 'Microsoft.Crank.Agent' were found. You can use the --prerelease or --yes option to use the latest preview version of the package (currently 0.2.0-alpha.25128.2)`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.