Skip to content

Instantly share code, notes, and snippets.

@droyad
Created March 1, 2019 05:13
Show Gist options
  • Save droyad/9c64bb908cd284736ec6cf08da0e34a1 to your computer and use it in GitHub Desktop.
Save droyad/9c64bb908cd284736ec6cf08da0e34a1 to your computer and use it in GitHub Desktop.
using NuGet.Packaging;
using NuGet.Frameworks;
using (var reader = new PackageArchiveReader(stream, true))
{
var nuspecFile = reader.GetNuspecFile();
if (nuspecFile == null)
throw new Exception("Package does not contain a nuspec file");
using (var s = reader.GetStream(nuspecFile))
{
var manifest = Manifest.ReadFrom(s, false);
return (
manifest,
reader.GetSupportedFrameworks().ToArray()
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment