Skip to content

dotnet nuget why does not give an error if only a project path was specified #14030

@jeffkl

Description

@jeffkl

NuGet Product Used

dotnet.exe

Product Version

9.0.2xx

Worked before?

No response

Impact

None

Repro Steps & Context

If you run dotnet nuget why and specify just a project path, the command assumes that the argument is a package name and then looks in the current directory for a project which leads to the wrong errors being logged. Instead, our command-line argument parser could call File.Exists() on the single argument to see if the user specified a path and then correctly log the fact that the user failed to specify a package.

We've had to disable Dotnet.Integration.Test.DotnetWhyTests.WhyCommand_EmptyPackageArgument_Fails() for now until this is fixed.

Verbose Logs

D:\nuget3\.test\work\2b6fe9ec\52de6c5f\solution\Test.Project.DotnetNugetWhy>dotnet nuget why D:\nuget3\src\NuGet.Core\NuGet.Build.Tasks.Console\NuGet.Build.Tasks.Console.csproj
Project 'Test.Project.DotnetNugetWhy' does not have a dependency on 'D:\nuget3\src\NuGet.Core\NuGet.Build.Tasks.Console\NuGet.Build.Tasks.Console.csproj'.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions