Skip to content

API Host RuntimeOptionsBuilder

Liu.Yandong.Hanks edited this page Aug 21, 2026 · 3 revisions

RuntimeOptionsBuilder

Mutable builder used by EngineOptions.WithRuntime.

Back to .NET Host API Reference

Overview

Mutable builder used by EngineOptions.WithRuntime.

Quick Reference

var options = EngineOptions.Default.WithRuntime(builder => builder.WithHotReload(true).WithStringPooling(StringPoolingStrategy.Intern));

Constructors

RuntimeOptionsBuilder(RuntimeOptions options)

Initializes the builder from existing immutable options.

RuntimeOptionsBuilder(RuntimeOptions options)

Parameters

Name Type Required Description
options RuntimeOptions Yes Options copied into the mutable builder.

Returns

A new builder instance.

Properties

HotReload

Gets or sets hot-reload behavior.

bool HotReload

Parameters

None.

Returns

Returns bool.

JsonSerializer

Gets or sets the runtime JSON serializer.

ScriptJsonSerializer JsonSerializer

Parameters

None.

Returns

Returns ScriptJsonSerializer.

DateTimeFormat

Gets or sets the runtime date-time format.

string DateTimeFormat

Parameters

None.

Returns

Returns string.

ConsoleStdOut

Gets or sets the standard-output writer.

TextWriter ConsoleStdOut

Parameters

None.

Returns

Returns TextWriter.

ConsoleErrorOut

Gets or sets the error-output writer.

TextWriter ConsoleErrorOut

Parameters

None.

Returns

Returns TextWriter.

StringPooling

Gets or sets the string-pooling strategy.

StringPoolingStrategy StringPooling

Parameters

None.

Returns

Returns StringPoolingStrategy.

Methods

WithHotReload

Sets HotReload and returns this builder for chaining.

RuntimeOptionsBuilder WithHotReload(bool value)

Parameters

Name Type Required Description
value bool Yes New value for hot-reload behavior.

Returns

Returns RuntimeOptionsBuilder.

WithJsonSerializer

Sets JsonSerializer and returns this builder for chaining.

RuntimeOptionsBuilder WithJsonSerializer(ScriptJsonSerializer value)

Parameters

Name Type Required Description
value ScriptJsonSerializer Yes New value for the runtime json serializer.

Returns

Returns RuntimeOptionsBuilder.

WithDateTimeFormat

Sets DateTimeFormat and returns this builder for chaining.

RuntimeOptionsBuilder WithDateTimeFormat(string value)

Parameters

Name Type Required Description
value string Yes New value for the runtime date-time format.

Returns

Returns RuntimeOptionsBuilder.

WithConsoleStdOut

Sets ConsoleStdOut and returns this builder for chaining.

RuntimeOptionsBuilder WithConsoleStdOut(TextWriter value)

Parameters

Name Type Required Description
value TextWriter Yes New value for the standard-output writer.

Returns

Returns RuntimeOptionsBuilder.

WithConsoleErrorOut

Sets ConsoleErrorOut and returns this builder for chaining.

RuntimeOptionsBuilder WithConsoleErrorOut(TextWriter value)

Parameters

Name Type Required Description
value TextWriter Yes New value for the error-output writer.

Returns

Returns RuntimeOptionsBuilder.

WithStringPooling

Sets StringPooling and returns this builder for chaining.

RuntimeOptionsBuilder WithStringPooling(StringPoolingStrategy value)

Parameters

Name Type Required Description
value StringPoolingStrategy Yes New value for the string-pooling strategy.

Returns

Returns RuntimeOptionsBuilder.

Clone this wiki locally