Class PackageReference
Represents a package element in the packages.config file
public class PackageReference
- Inheritance
-
PackageReference
- Inherited Members
Constructors
PackageReference(PackageIdentity, NuGetFramework)
Creates a new packages config entry
public PackageReference(PackageIdentity identity, NuGetFramework targetFramework)
Parameters
identity
PackageIdentitytargetFramework
NuGetFramework
PackageReference(PackageIdentity, NuGetFramework, bool)
Creates a new packages config entry
public PackageReference(PackageIdentity identity, NuGetFramework targetFramework, bool userInstalled)
Parameters
identity
PackageIdentitytargetFramework
NuGetFrameworkuserInstalled
bool
PackageReference(PackageIdentity, NuGetFramework, bool, bool, bool)
Creates a new packages config entry
public PackageReference(PackageIdentity identity, NuGetFramework targetFramework, bool userInstalled, bool developmentDependency, bool requireReinstallation)
Parameters
identity
PackageIdentitytargetFramework
NuGetFrameworkuserInstalled
booldevelopmentDependency
boolrequireReinstallation
bool
PackageReference(PackageIdentity, NuGetFramework, bool, bool, bool, VersionRange)
Creates a new packages config entry
public PackageReference(PackageIdentity identity, NuGetFramework targetFramework, bool userInstalled, bool developmentDependency, bool requireReinstallation, VersionRange allowedVersions)
Parameters
identity
PackageIdentityPackage id and version
targetFramework
NuGetFrameworkPackage target framework installed to the project
userInstalled
boolTrue if the user installed this package directly
developmentDependency
boolTrue if the package is a development dependency
requireReinstallation
boolTrue if this package needs to be reinstalled
allowedVersions
VersionRangeRestrict package versions to the allowedVersions range
Properties
AllowedVersions
The allowed range of versions that this package can be upgraded/downgraded to.
public VersionRange AllowedVersions { get; }
Property Value
- VersionRange
Remarks
This is null if unbounded
HasAllowedVersions
True if allowedVersions exists.
public bool HasAllowedVersions { get; }
Property Value
IsDevelopmentDependency
Development dependency
public bool IsDevelopmentDependency { get; }
Property Value
IsUserInstalled
True if the user installed or updated this package directly. False if this package was installed as a dependency by another package.
public bool IsUserInstalled { get; }
Property Value
PackageIdentity
Id and Version of the package
public PackageIdentity PackageIdentity { get; }
Property Value
RequireReinstallation
Require reinstallation
public bool RequireReinstallation { get; }
Property Value
TargetFramework
Installed target framework version of the package.
public NuGetFramework TargetFramework { get; }
Property Value
- NuGetFramework
Methods
ToString()
Displays the identity and target framework of the reference.
public override string ToString()