Class DotNetCorePathProvider
- Namespace
- AsmResolver.DotNet
- Assembly
- AsmResolver.DotNet.dll
Provides a mechanism for looking up versioned runtimes in a .NET Core / .NET 5.0+ installation folder.
public class DotNetCorePathProvider
- Inheritance
-
DotNetCorePathProvider
- Inherited Members
Constructors
DotNetCorePathProvider()
Creates a new .NET installation path provider, using the DefaultInstallationPath as the installation path.
public DotNetCorePathProvider()
DotNetCorePathProvider(string?)
Creates a new .NET installation path provider, using the provided installation folder for .NET.
public DotNetCorePathProvider(string? installationDirectory)
Parameters
installationDirectory
stringThe .NET installation folder.
Properties
Default
Gets the default path provider representing the global .NET installation on the current system.
public static DotNetCorePathProvider Default { get; }
Property Value
DefaultInstallationPath
Gets the installation path of the .NET installation on the current system.
public static string? DefaultInstallationPath { get; }
Property Value
Methods
GetRuntimePathCandidates(string, Version)
Collects all paths to the runtimes that implement the provided .NET or .NET Core runtime version.
public IEnumerable<string> GetRuntimePathCandidates(string runtimeName, Version runtimeVersion)
Parameters
Returns
- IEnumerable<string>
A collection of paths that implement the requested version.
GetRuntimePathCandidates(Version)
Collects all paths to the runtimes that implement the provided .NET or .NET Core runtime version.
public IEnumerable<string> GetRuntimePathCandidates(Version requestedRuntimeVersion)
Parameters
requestedRuntimeVersion
VersionThe requested .NET or .NET Core version.
Returns
- IEnumerable<string>
A collection of paths that implement the requested version.
HasRuntimeInstalled(string, Version)
Determines whether a specific version of the runtime is installed or not.
public bool HasRuntimeInstalled(string runtimeName, Version runtimeVersion)
Parameters
Returns
- bool
true
if the version is installed,false
otherwise.
HasRuntimeInstalled(Version)
Determines whether a specific version of the runtime is installed or not.
public bool HasRuntimeInstalled(Version runtimeVersion)
Parameters
runtimeVersion
VersionThe runtime version.
Returns
- bool
true
if the version is installed,false
otherwise.
TryGetLatestStandardCompatibleVersion(Version, out Version?)
Attempts to get the most recent version of .NET Core or .NET that is compatible with the provided .NET standard version.
public bool TryGetLatestStandardCompatibleVersion(Version standardVersion, out Version? coreVersion)
Parameters
standardVersion
VersionThe .NET standard version.
coreVersion
VersionThe most recent compatible .NET or .NET Core version available.
Returns
- bool
true
if a compatible version was found,false
otherwise.