question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet add local package -> error: Value cannot be null. error: Parameter name: path1

See original GitHub issue

Steps to reproduce

I’m on macOS 10.14.2 dotnet version 2.2.103

  1. Create a C# class library project
  2. Add package metadata to the project file
  • inside the existing <PropertyGroup> tag, <PackageId>mylib</PackageId> <Version>1.0.0</Version> <Authors>MyName</Authors> <Company>MyCompany</Company>
  1. Run the pack command $ dotnet pack 4 $ nuget add mylib.nupkg -source /Users/myname/nuget_repo 5 $ dotnet nuget push mylib.1.0.0.nupkg -s my-nuget In my ConsoleApp project try to add my nuget package: 6 $ dotnet add package mylib -s /Users/myname/nuget-repo

Expected behavior

Successfully adding my Nuget package.

Actual behavior

myname:MyConsoleApp myname$ dotnet add package mylib Writing /var/folders/cr/4pk4646d1_x5tl_tbbbbvqkw0000gn/T/tmpyagAXi.tmp info : Adding PackageReference for package ‘mylib’ into project ‘/Users/myname/Projects/MyConsoleApp/MyConsoleApp.csproj’. log : Restoring packages for /Users/myname/Projects/MyConsoleApp/MyConsoleApp.csproj… info : Package ‘mylib’ is compatible with all the specified frameworks in project ‘/Users/myname/Projects/MyConsoleApp/MyConsoleApp.csproj’. error: Value cannot be null. error: Parameter name: path1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Rakiahcommented, Mar 21, 2019

I have the same problem but using a remote private NuGet server, any updates please ??

1reaction
livarcocccommented, Jan 29, 2019

@wli3 can you take a look?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dotnet add package error: Value cannot be null. ( ...
Attempting to add a nuget package to a new console application results in the error Value cannot be null. (Parameter 'path1').
Read more >
How to solve NuGet.targets(124,5): error : Value cannot be ...
So to solve this I am running the command dotnet restore in package manager console. But on running I'm getting the below error....
Read more >
How to resolve NuGet.targets(128,5): error : Value cannot ...
I am getting this error when it is running the command dotnet restore ... How to resolve NuGet.targets(128,5): error : Value cannot be...
Read more >
nuget restore fails with code(1) and error(Value cannot be ...
Parameter name : key failed with code(1) and error(Value cannot be null. Packages failed to restore. The steps in my build are:.
Read more >
Why do I get an error "value cannot be null (Parameter ...
I am using the example code from https://learn.microsoft.com/en-us/answers/questions/299791/saving-to-appsettingsjson.html.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found