Responsive Ad Area

Share This Post

test

Not authorised to run FindPackagesById on private repository url – Nuget

I’m running the following code:

// ---- Download and install a package at a desired path ----
string packageID = "<id>";
var sourceUri = "<privateurl>";
string version = "<version>";
string packagesPath = "<>";
string packagesConfigPath = "<>/packages.config";

//Connect to the official package repository
IPackageRepository sourceRepository = PackageRepositoryFactory.Default.CreateRepository(sourceUri);

IPackage package = sourceRepository
    .FindPackagesById(packageID)
    .SingleOrDefault(p => p.Version.ToFullString()
    .Equals(version));

and it throws this error:

System.InvalidOperationException: An error occurred while loading packages from '<privateurl>/nuget/v3/index.json': The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.

What am i doing wrong?

In my nuget package manager settings i see the url in there and also in my nuget.config i see it in there and i’m authorised to use it.


Not authorised to run FindPackagesById on private repository url – Nuget
Not authorised to run FindPackagesById on private repository url – Nuget
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar