Table of Contents

Class NuspecReader

Namespace
NuGet.Packaging
Assembly
Chocolatey.NuGet.Packaging.dll

Reads .nuspec files

public class NuspecReader : NuspecCoreReaderBase, INuspecCoreReader
Inheritance
NuspecReader
Implements
Inherited Members

Constructors

NuspecReader(Stream)

Nuspec file reader

public NuspecReader(Stream stream)

Parameters

stream Stream

Nuspec file stream.

NuspecReader(Stream, IFrameworkNameProvider, bool)

Nuspec file reader

public NuspecReader(Stream stream, IFrameworkNameProvider frameworkProvider, bool leaveStreamOpen)

Parameters

stream Stream

Nuspec file stream.

frameworkProvider IFrameworkNameProvider

Framework mapping provider for NuGetFramework parsing.

leaveStreamOpen bool

NuspecReader(string)

Nuspec file reader.

public NuspecReader(string path)

Parameters

path string

NuspecReader(string, IFrameworkNameProvider)

Nuspec file reader.

public NuspecReader(string path, IFrameworkNameProvider frameworkProvider)

Parameters

path string
frameworkProvider IFrameworkNameProvider

NuspecReader(XDocument)

Nuspec file reader

public NuspecReader(XDocument xml)

Parameters

xml XDocument

Nuspec file xml data.

NuspecReader(XDocument, IFrameworkNameProvider)

Nuspec file reader

public NuspecReader(XDocument xml, IFrameworkNameProvider frameworkProvider)

Parameters

xml XDocument

Nuspec file xml data.

frameworkProvider IFrameworkNameProvider

Framework mapping provider for NuGetFramework parsing.

Methods

GetAuthors()

Package authors.

public string GetAuthors()

Returns

string

GetBugTrackerUrl()

public string GetBugTrackerUrl()

Returns

string

GetConflicts()

public string GetConflicts()

Returns

string

GetContentFiles()

Build action groups

public IEnumerable<ContentFilesEntry> GetContentFiles()

Returns

IEnumerable<ContentFilesEntry>

GetCopyright()

Copyright information.

public string GetCopyright()

Returns

string

GetDependencyGroups()

Read package dependencies for all frameworks

public IEnumerable<PackageDependencyGroup> GetDependencyGroups()

Returns

IEnumerable<PackageDependencyGroup>

GetDependencyGroups(bool)

Read package dependencies for all frameworks

public IEnumerable<PackageDependencyGroup> GetDependencyGroups(bool useStrictVersionCheck)

Parameters

useStrictVersionCheck bool

Returns

IEnumerable<PackageDependencyGroup>

GetDescription()

Package description.

public string GetDescription()

Returns

string

GetDocsUrl()

public string GetDocsUrl()

Returns

string

GetFrameworkAssemblyGroups()

Framework assembly groups

public IEnumerable<FrameworkSpecificGroup> GetFrameworkAssemblyGroups()

Returns

IEnumerable<FrameworkSpecificGroup>

GetFrameworkRefGroups()

Read package dependencies for all frameworks

public IEnumerable<FrameworkReferenceGroup> GetFrameworkRefGroups()

Returns

IEnumerable<FrameworkReferenceGroup>

GetFrameworkReferenceGroups()

Framework assembly groups

[Obsolete("GetFrameworkReferenceGroups() is deprecated. Please use GetFrameworkAssemblyGroups() instead.")]
public IEnumerable<FrameworkSpecificGroup> GetFrameworkReferenceGroups()

Returns

IEnumerable<FrameworkSpecificGroup>

GetIcon()

Gets the icon metadata from the .nuspec

public string GetIcon()

Returns

string

A string containing the icon path or null if no icon entry is found

GetIconUrl()

Package icon url.

public string GetIconUrl()

Returns

string

GetLanguage()

Package language

public string GetLanguage()

Returns

string

GetLicenseMetadata()

Parses the license object if specified. The metadata can be of 2 types, Expression and File. The method will not fail if it sees values that invalid (empty/unparseable license etc), but it will rather add validation errors/warnings.

public LicenseMetadata GetLicenseMetadata()

Returns

LicenseMetadata

The licensemetadata if specified

Remarks

This method never throws. Bad data is still parsed.

GetLicenseUrl()

Package License Url

public string GetLicenseUrl()

Returns

string

GetMailingListUrl()

public string GetMailingListUrl()

Returns

string

GetOwners()

Package owners.

public string GetOwners()

Returns

string

GetPackageSourceUrl()

public string GetPackageSourceUrl()

Returns

string

GetProjectSourceUrl()

public string GetProjectSourceUrl()

Returns

string

GetProjectUrl()

Package project url.

public string GetProjectUrl()

Returns

string

GetProvides()

public string GetProvides()

Returns

string

GetReadme()

Gets the readme metadata from the .nuspec

public string GetReadme()

Returns

string

A string containing the readme path or null if no readme entry is found

GetReferenceGroups()

Reference item groups

public IEnumerable<FrameworkSpecificGroup> GetReferenceGroups()

Returns

IEnumerable<FrameworkSpecificGroup>

GetReleaseNotes()

Package release notes.

public string GetReleaseNotes()

Returns

string

GetReplaces()

public string GetReplaces()

Returns

string

GetRepositoryMetadata()

Source control repository information.

public RepositoryMetadata GetRepositoryMetadata()

Returns

RepositoryMetadata

GetRequireLicenseAcceptance()

Require license acceptance when installing the package.

public bool GetRequireLicenseAcceptance()

Returns

bool

GetSoftwareDisplayName()

public string GetSoftwareDisplayName()

Returns

string

GetSoftwareDisplayVersion()

public string GetSoftwareDisplayVersion()

Returns

string

GetSummary()

Package summary.

public string GetSummary()

Returns

string

GetTags()

Package tags.

public string GetTags()

Returns

string

GetTitle()

Package title.

public string GetTitle()

Returns

string

GetWikiUrl()

public string GetWikiUrl()

Returns

string