dotnet CLI “error: There are no versions available for the package 'myCustomPackage'.”

1k views Asked by At

I've added my private source of packages that hosted on gitlab by this command

dotnet nuget add source

its done successfully and added to my list of sources, then I've pushed my packages on it, the packages are also up when I check them on gitlab repo/packages & registeries. Now the problem is when I want to add this packages on other projects:

dotnet add package <myPackageName> -s <mySourceNameThatHasAlreadyAdded>

enter image description here

dotnet Cli says There are no versions available for the package <myPackageName> however already two versions of this package available on gitlab(mySourceNameThatHasAlreadyAdded).

how colud I solve this issue?

1

There are 1 answers

0
Vahid On BEST ANSWER

I found the solution, I don't know why but the issue was resolved by eliminating the

-s <mySourceNameThatHasAlreadyAdded>

from the add command and just write

dotnet add package <myPackageName>

and because my private source package is the only package source in the result of

dotnet nuget list source

command, without any idea now it works!