Skip to content

Null Argument Passed to Path.Combine When Pushing Symbols #10645

Open
@BryceBarbara

Description

@BryceBarbara

From what I can tell, this problem only occurs on linux.

If the Folder or project name is the same as package name, you'll get a null reference. More detail about it can be found here.

The problem code doesn't check if symbolPath is null or empty.

The simple fix would probably be

return string.IsNullOrEmpty(symbolPath) ? packageDir : Path.Combine(packageDir, symbolPath);

Details about Problem

NuGet product used: dotnet.exe

Product version: Whatever comes with .NET 5.0.201

Worked before? If so, with which NuGet version: Nope.

Repro steps and/or sample project

  1. Create a new project named TestProject in a new solution with the same name.
  2. Have the project get created inside a child folder of the solution.
  3. Solution relative path to the project file should be: .\TestProject\TestProject.csproj
  4. Using a linux machine, try to use dotnet nuget push -s to push the project and the symbols.
  5. The package will be pushed but the symbols will error out.

Verbose Logs

Can't include logs since nuget in linux doesn't support the verbosity flag.

executing: [dotnet nuget push *.nupkg -s default -k *** --skip-duplicate]
Your package was pushed.
error: Value cannot be null. (Parameter 'path2')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions