Created
March 1, 2019 05:13
-
-
Save droyad/9c64bb908cd284736ec6cf08da0e34a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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