Table of Contents

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 string

The .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

DotNetCorePathProvider

DefaultInstallationPath

Gets the installation path of the .NET installation on the current system.

public static string? DefaultInstallationPath { get; }

Property Value

string

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

runtimeName string
runtimeVersion Version

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 Version

The 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

runtimeName string

The name of the runtime.

runtimeVersion Version

The runtime version.

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 Version

The 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 Version

The .NET standard version.

coreVersion Version

The most recent compatible .NET or .NET Core version available.

Returns

bool

true if a compatible version was found, false otherwise.