NuGetPackageValidationContext Class
Provides context information and methods for validating a NuGet package.
public sealed class NuGetPackageValidationContext : IDisposable- Implements
Properties
| Name | Description |
|---|---|
| CancellationToken | Gets the cancellation token for the validation operation. |
| Package | Gets the package reader for accessing the contents of the NuGet package. |
| PackagePath | Gets the path to the NuGet package being validated. |
| SymbolPackage | Gets the package reader for the symbol package (.snupkg) if it exists alongside the main package. |
| SymbolServers | Gets the collection of symbol server URLs configured for checking symbol availability. |
CancellationToken
NuGetPackageValidationContext.csGets the cancellation token for the validation operation.
public CancellationToken CancellationToken { get; }Property value
Gets the package reader for accessing the contents of the NuGet package.
public PackageReaderBase Package { get; }Property value
PackageReaderBase
PackagePath
NuGetPackageValidationContext.csSymbolPackage
NuGetPackageValidationContext.csGets the package reader for the symbol package (.snupkg) if it exists alongside the main package.
public PackageReaderBase? SymbolPackage { get; }Property value
PackageReaderBase?
SymbolServers
NuGetPackageValidationContext.csGets the collection of symbol server URLs configured for checking symbol availability.
public IEnumerable<Uri> SymbolServers { get; }Property value
Methods
| Name | Description |
|---|---|
| Dispose() | |
| IsRuleExcluded(int) | Determines whether a specific validation rule is excluded from validation. |
| ReportError(int, string, string?, string?) | Reports a validation error found during package validation. |
Dispose()
NuGetPackageValidationContext.cspublic void Dispose()No documentation is available.
IsRuleExcluded(int)
NuGetPackageValidationContext.csReportError(int, string, string?, string?)
NuGetPackageValidationContext.csReports a validation error found during package validation.
public void ReportError(int errorCode, string message, string? helpText = null, string? fileName = null)Parameters
errorCodeint- The numeric error code identifying the type of validation error.
messagestring- A human-readable message describing the validation error.
helpTextstring?- Optional help text providing guidance on how to fix the error.
fileNamestring?- Optional file name within the package where the error was found.