Is there anyway to read the metadata of a NuGet-package-file?
I would really like to create a simple site for searching among my nupkg-files..
Thanks in advance!
Extracting Nupkg files using command line Or just simply extract package with zip either by opening it in zip or by changing extension to . zip and just extracting it.
Menu Tools → Options → Package Manager Give a name and folder location. Click OK. Drop your NuGet package files in that folder. Go to your Project in Solution Explorer, right click and select "Manage NuGet Packages".
Package metadata describes a package for its consumers: who wrote it, where its repository is, and what versions of it have been published. It also contains a description of each version of a package present in the registry, listing its dependencies, giving the url of its tarball, and so on.
The NuGet.Core package contains the official API for reading package metadata.
To read information about a single .nupkg file use code similar to following.
var myPackage = new ZipPackage(@"C:\Path\to\MyPackage.1.0.0.nupkg");
Console.WriteLine("Id: {0}", myPackage.Id);
Console.WriteLine("Version: {0}", myPackage.Version);
Console.WriteLine(
"Assemblies: {0}",
myPackage.AssemblyReferences.Select(a => a.Name).ToArray());
There are also similar classes for reading Package sources (aka Feeds), etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With