Andrey Shchekin
Andrey Shchekin

Reputation: 21599

How to read local packages folder using NuGet?

I am trying to read my local solution packages folder using NuGet.Core.

If I create new UnzippedPackageRepository(pathToPackages) and call GetPackages() on it, the result is empty. I am looking at the source of UnzippedPackageRepository and it has:

from file in FileSystem.GetFiles("", "*" + Constants.PackageExtension)
let packageName = Path.GetFileNameWithoutExtension(file)
where FileSystem.DirectoryExists(packageName)
select new UnzippedPackage(FileSystem, packageName)

So it seems to expect *.nupkg for each package in top level?

Anyway, what is right way to read solution package store aside from going through each folder and creating UnzippedPackage manually?

Upvotes: 0

Views: 239

Answers (1)

Andrey Shchekin
Andrey Shchekin

Reputation: 21599

Solved it, solution packages folder is handled by SharedPackageRepository.

Upvotes: 2

Related Questions