Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet nuget package list -- error: Value cannot be null. (Parameter 'path') #43936

Open
richlander opened this issue Oct 6, 2024 · 0 comments
Labels
Area-NuGet untriaged Request triage from a team member

Comments

@richlander
Copy link
Member

Looks like dotnet nuget package list could do a check to determine if the project is restored. It seems to do that when the project is specified explicitly.

C:\Users\rlander\dotnet8proj>dotnet nuget package
NuGet Command Line 6.12.0.81

Usage: NuGet.CommandLine.XPlat.dll package [options] [command]

Options:
  -h|--help  Show help information
  --version  Show version information

Commands:
  add     Adds a package reference to a project.
  list    Lists all the packages used by the current project(s).
  remove  Removes a package reference from a project.

Use "NuGet.CommandLine.XPlat.dll package [command] --help" for more information about a command.


C:\Users\rlander\dotnet8proj>dotnet nuget package list
error: Value cannot be null. (Parameter 'path')

C:\Users\rlander\dotnet8proj>dotnet nuget package list dotnet8proj.csproj
No assets file was found for `dotnet8proj.csproj`. Please run restore before running this command.

C:\Users\rlander\dotnet8proj>dotnet restore
Restore succeeded with 1 warning(s) in 0.9s
    C:\Users\rlander\dotnet8proj\dotnet8proj.csproj : warning NU1903: Package 'System.Formats.Asn1' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-447r-wph3-92pm

Build succeeded with 1 warning(s) in 1.0s

C:\Users\rlander\dotnet8proj>dotnet nuget package list dotnet8proj.csproj
Project 'dotnet8proj' has the following package references
   [net8.0]:
   Top-level Package          Requested   Resolved
   > System.Formats.Asn1      8.0.0       8.0.0

C:\Users\rlander\dotnet8proj>type dotnet8proj.csproj
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="System.Formats.Asn1" Version="8.0.0" />
  </ItemGroup>

</Project>

C:\Users\rlander\dotnet8proj>dotnet --version
9.0.100-rc.1.24452.12

Also, is the following our pattern, with NuGet.CommandLine.XPlat.dll? I assume not.

Use "NuGet.CommandLine.XPlat.dll package [command] --help" 
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NuGet untriaged Request triage from a team member labels Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NuGet untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant