Support `dotnet tool install` from local nuget package file
See original GitHub issueIs there are way to install dotnet tools from nupkg files created by dotnet pack <project>
?
I want to quickly install and test my CLI tool but dotnet tool install
requires installation from a nuget source.
I can create a local nuget source with nuget add source d:\path\to\nuget\files
but a way to directly install nupkg files would be great
>dotnet tool install -g My.Package.1.0.0.nupkg
error NU1101: Unable to find package my.package.cli.1.0.0.nupkg. No packages exist with this id in source(s): dotnet.myget.org roslyn, local, Microsoft Visual Studio Offline Packages, nuget.org
The tool package could not be restored.
Tool 'my.package.1.0.0.nupkg' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
>dotnet --list-sdks
3.1.201 [C:\Program Files\dotnet\sdk]
3.1.302 [C:\Program Files\dotnet\sdk]
3.1.401 [C:\Program Files\dotnet\sdk]
5.0.100-preview.7.20366.6 [C:\Program Files\dotnet\sdk]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:7
Top Results From Across the Web
dotnet tool install command - .NET CLI
The dotnet tool install command installs the specified .NET tool on your machine.
Read more >Add a package with a local package file in 'dotnet'
Using the dotnet command line tool, how can I add a reference to an existing local package that is not downloaded with NuGet?...
Read more >dotnet-tool-install: Installs the specified .NET tool on ...
The dotnet tool install command provides a way for you to install .NET tools on your machine. To use the command, you specify...
Read more >Unable to install dotnet tool from private nuget feed
I have a dotnet tool that is published as a Nuget package to a private feed. From a YAML pipeline I would like...
Read more >New in .NET Core 3.0: local tools
In this post I show how to install and run local tools in .NET Core 3.0 using a dotnet-tools manifest and discuss how...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think that you can use:
dotnet tool install --global --add-source <path-to-your-nuget-package> <tool-name>
Just a quick note because I did the mistake,
<path-to-your-nuget-package>
is the path of the folder, not the nupkg file. File name is loaded from<tool-name>