Home: NuGet.CommandLine as dotnet global tool

Created on 26 Jun 2019  路  4Comments  路  Source: NuGet/Home

I'm resolving various tools in a build script using dotnet tool install:

dotnet tool install altcover.global --tool-path tools
dotnet tool install Codecov.Tool --tool-path tools

# ...

tools\altcover --inputDirectory=...
tools\codecov --name=...

(After 3.0 is released, I'll be using the beautiful and amazing https://github.com/dotnet/cli/issues/10288 to do the same thing.)

One of the tasks I want to do from the build script is nuget sign. It would be cool if this just worked:

dotnet tool install NuGet.CommandLine --tool-path tools

tools\nuget sign -CertificateFingerprint ...

Instead, this prints:

error NU1212: Invalid project-package combination for NuGet.CommandLine 5.0.2. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
Tool 'nuget.commandline' 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 Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

Would adding the package type DotnetTool to NuGet.CommandLine be possible?

NuGet.exe Duplicate

All 4 comments

we are working on adding package verification & signing to dotnet.exe -- and making it work cross platform. We are targeting netcore 3.0, but unsure if it will all land by that release.

We don't plan on making nuget.exe distributable as a tool, but appreciate the suggestion.

Package signing via dotnet is even better. Thanks! Is there an issue I can track for notifications on this?

At the bottom of https://github.com/NuGet/NuGet.Client/pull/2706 are link to several issues tracking the necessary work.
Current work is happening here: https://github.com/NuGet/Home/issues/8043

(added missing "closedas:duplicate" label so this doesn't show up in release notes)

Was this page helpful?
0 / 5 - 0 ratings