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
installationDirectorystringThe .NET installation folder. This should be the path to the directory containing the main
dotnetordotnet.exeCLI utility.
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 path to 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
requestedRuntimeVersionVersionThe 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
trueif the version is installed,falseotherwise.
HasRuntimeInstalled(Version)
Determines whether a specific version of the runtime is installed or not.
public bool HasRuntimeInstalled(Version runtimeVersion)
Parameters
runtimeVersionVersionThe runtime version.
Returns
- bool
trueif the version is installed,falseotherwise.
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
standardVersionVersionThe .NET standard version.
coreVersionVersionThe most recent compatible .NET or .NET Core version available.
Returns
- bool
trueif a compatible version was found,falseotherwise.