Table of Contents

Class RuntimeConfiguration

Namespace
AsmResolver.DotNet.Config.Json
Assembly
AsmResolver.DotNet.dll

Represents the root object of a runtime configuration, stored in a *.runtimeconfig.json file.

public class RuntimeConfiguration
Inheritance
RuntimeConfiguration
Inherited Members

Constructors

RuntimeConfiguration()

Creates a new empty runtime configuration.

public RuntimeConfiguration()

RuntimeConfiguration(RuntimeOptions)

Creates a new runtime configuration with the provided options.

public RuntimeConfiguration(RuntimeOptions options)

Parameters

options RuntimeOptions

Properties

RuntimeOptions

Gets or sets the runtime options.

public RuntimeOptions RuntimeOptions { get; set; }

Property Value

RuntimeOptions

Methods

FromFile(string)

Parses runtime configuration from a JSON file.

public static RuntimeConfiguration? FromFile(string path)

Parameters

path string

The path to the runtime configuration file.

Returns

RuntimeConfiguration

The parsed runtime configuration.

FromJson(string)

Parses runtime configuration from a JSON string.

public static RuntimeConfiguration? FromJson(string json)

Parameters

json string

The raw json string configuration file.

Returns

RuntimeConfiguration

The parsed runtime configuration.

ToJson()

Serializes the configuration to a JSON string.

public string ToJson()

Returns

string

The JSON string.

TryGetTargetRuntime(out DotNetRuntimeInfo)

Attempts to determine the target runtime based on the contents of the runtime configuration file.

public bool TryGetTargetRuntime(out DotNetRuntimeInfo targetRuntime)

Parameters

targetRuntime DotNetRuntimeInfo

The target runtime.

Returns

bool

true if the runtime was determined successfully, false otherwise.

Write(string)

Writes the configuration to a file.

public void Write(string path)

Parameters

path string

The path to the JSON output file.