OpenMod Docs OpenMod Docs
OpenMod Docs OpenMod Docs
OpenMod .NET Plugin Framework.

Class NuGetPackageManager

Inheritance
System.Object
NuGetPackageManager
Namespace: OpenMod.NuGet
Assembly: OpenMod.NuGet.dll
Syntax
public class NuGetPackageManager : IDisposable

Constructors

| Improve this Doc View Source

NuGetPackageManager(String)

Declaration
public NuGetPackageManager(string packagesDirectory)
Parameters
Type Name Description
System.String packagesDirectory
| Improve this Doc View Source

NuGetPackageManager(String, Boolean)

Declaration
public NuGetPackageManager(string packagesDirectory, bool usePackagesFiles)
Parameters
Type Name Description
System.String packagesDirectory
System.Boolean usePackagesFiles

Properties

| Improve this Doc View Source

AssemblyResolverInstalled

Declaration
public bool AssemblyResolverInstalled { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Logger

Declaration
public ILogger Logger { get; set; }
Property Value
Type Description
ILogger
| Improve this Doc View Source

PackagesDirectory

Declaration
public string PackagesDirectory { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

ClearCache(Boolean)

Declaration
public void ClearCache(bool clearGlobalCache = false)
Parameters
Type Name Description
System.Boolean clearGlobalCache
| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

GetDependenciesAsync(PackageIdentity)

Declaration
public virtual Task<ICollection<PackageDependency>> GetDependenciesAsync(PackageIdentity identity)
Parameters
Type Name Description
PackageIdentity identity
Returns
Type Description
Task<ICollection<PackageDependency>>
| Improve this Doc View Source

GetLatestPackageIdentityAsync(String)

Declaration
public virtual Task<PackageIdentity?> GetLatestPackageIdentityAsync(string packageId)
Parameters
Type Name Description
System.String packageId
Returns
Type Description
Task<System.Nullable<PackageIdentity>>
| Improve this Doc View Source

GetLoadedAssemblies()

Declaration
public virtual ICollection<NuGetAssembly> GetLoadedAssemblies()
Returns
Type Description
ICollection<NuGetAssembly>
| Improve this Doc View Source

GetNugetPackageFile(PackageIdentity)

Declaration
public virtual string GetNugetPackageFile(PackageIdentity identity)
Parameters
Type Name Description
PackageIdentity identity
Returns
Type Description
System.String
| Improve this Doc View Source

IgnoreDependencies(String[])

Declaration
public void IgnoreDependencies(params string[] packageIds)
Parameters
Type Name Description
System.String[] packageIds
| Improve this Doc View Source

InstallAssemblyResolver()

Declaration
public virtual void InstallAssemblyResolver()
| Improve this Doc View Source

InstallAsync(PackageIdentity, Boolean)

Declaration
public virtual Task<NuGetInstallResult> InstallAsync(PackageIdentity packageIdentity, bool allowPreReleaseVersions = false)
Parameters
Type Name Description
PackageIdentity packageIdentity
System.Boolean allowPreReleaseVersions
Returns
Type Description
Task<NuGetInstallResult>
| Improve this Doc View Source

InstallMissingPackagesAsync(Boolean)

Declaration
public Task<int> InstallMissingPackagesAsync(bool updateExisting = true)
Parameters
Type Name Description
System.Boolean updateExisting
Returns
Type Description
Task<System.Int32>
| Improve this Doc View Source

InstallPackagesAsync(ICollection<PackageIdentity>, Boolean)

Declaration
public Task InstallPackagesAsync(ICollection<PackageIdentity> packages, bool updateExisting = true)
Parameters
Type Name Description
ICollection<PackageIdentity> packages
System.Boolean updateExisting
Returns
Type Description
Task
| Improve this Doc View Source

IsPackageInstalledAsync(String)

Declaration
public virtual Task<bool> IsPackageInstalledAsync(string packageId)
Parameters
Type Name Description
System.String packageId
Returns
Type Description
Task<System.Boolean>
| Improve this Doc View Source

LoadAssembliesFromNuGetPackageAsync(String)

Declaration
public virtual Task<IEnumerable<Assembly>> LoadAssembliesFromNuGetPackageAsync(string nupkgFile)
Parameters
Type Name Description
System.String nupkgFile
Returns
Type Description
Task<IEnumerable<Assembly>>
| Improve this Doc View Source

QueryDependenciesAsync(PackageIdentity, SourceCacheContext, Boolean)

Declaration
public virtual Task<NuGetQueryResult> QueryDependenciesAsync(PackageIdentity identity, SourceCacheContext cacheContext, bool allowPreReleaseVersions)
Parameters
Type Name Description
PackageIdentity identity
SourceCacheContext cacheContext
System.Boolean allowPreReleaseVersions
Returns
Type Description
Task<NuGetQueryResult>
| Improve this Doc View Source

QueryPackageDependenciesAsync(PackageIdentity, SourceCacheContext, IEnumerable<SourceRepository>, ISet<SourcePackageDependencyInfo>, Boolean)

Declaration
protected virtual Task QueryPackageDependenciesAsync(PackageIdentity package, SourceCacheContext cacheContext, IEnumerable<SourceRepository> repositories, ISet<SourcePackageDependencyInfo> availablePackages, bool allowPreReleaseVersions)
Parameters
Type Name Description
PackageIdentity package
SourceCacheContext cacheContext
IEnumerable<SourceRepository> repositories
ISet<SourcePackageDependencyInfo> availablePackages
System.Boolean allowPreReleaseVersions
Returns
Type Description
Task
| Improve this Doc View Source

QueryPackageExactAsync(String, Nullable<String>, Boolean)

Declaration
public virtual Task<IPackageSearchMetadata?> QueryPackageExactAsync(string packageId, string? version = null, bool includePreRelease = false)
Parameters
Type Name Description
System.String packageId
System.Nullable<System.String> version
System.Boolean includePreRelease
Returns
Type Description
Task<System.Nullable<IPackageSearchMetadata>>
| Improve this Doc View Source

QueryPackageLatestVersionAsync(PackageIdentity, SourceCacheContext, IEnumerable<SourceRepository>, Boolean)

Declaration
protected virtual Task<PackageIdentity> QueryPackageLatestVersionAsync(PackageIdentity package, SourceCacheContext cacheContext, IEnumerable<SourceRepository> repositories, bool allowPreReleaseVersions)
Parameters
Type Name Description
PackageIdentity package
SourceCacheContext cacheContext
IEnumerable<SourceRepository> repositories
System.Boolean allowPreReleaseVersions
Returns
Type Description
Task<PackageIdentity>
| Improve this Doc View Source

QueryPackagesAsync(String, Nullable<String>, Boolean)

Declaration
public virtual Task<IEnumerable<IPackageSearchMetadata>> QueryPackagesAsync(string packageId, string? version = null, bool includePreRelease = false)
Parameters
Type Name Description
System.String packageId
System.Nullable<System.String> version
System.Boolean includePreRelease
Returns
Type Description
Task<IEnumerable<IPackageSearchMetadata>>
| Improve this Doc View Source

RemoveAsync(PackageIdentity)

Declaration
public Task<bool> RemoveAsync(PackageIdentity packageIdentity)
Parameters
Type Name Description
PackageIdentity packageIdentity
Returns
Type Description
Task<System.Boolean>
| Improve this Doc View Source

RemoveOutdatedPackagesAsync()

Declaration
public Task RemoveOutdatedPackagesAsync()
Returns
Type Description
Task
| Improve this Doc View Source

SetAssemblyLoader(NuGetPackageManager.AssemblyLoader)

Declaration
public void SetAssemblyLoader(NuGetPackageManager.AssemblyLoader assemblyLoader)
Parameters
Type Name Description
NuGetPackageManager.AssemblyLoader assemblyLoader

Extension Methods

DisposeHelper.DisposeSyncOrAsync(Object)