Skip to content

API Host CompilationMode

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

CompilationMode

Controls how generated code is emitted and loaded.

Namespace: AuroraScript. Kind: enum.

Back to .NET Host API Reference

Overview

CompilationMode selects the emit strategy for compiled scripts. Set it through EngineOptions.WithCompiler, either as builder.Mode or builder.WithMode(...).

Quick Reference

var options = EngineOptions.Default.WithCompiler(builder =>
    builder.Mode = CompilationMode.Dynamic);

Values

Value Description
Persistence Persists compiled assembly output to a file or stream and can save DLL/PDB.
OnlyRun Compiles and runs in memory only and does not provide standard PDB debugging.
Dynamic Compiles to a dynamic method for ordinary high-performance execution.

CompilationMode.Persistence

Persists compiled assembly output to a file or stream and can save DLL/PDB.

var value = CompilationMode.Persistence;

CompilationMode.OnlyRun

Compiles and runs in memory only and does not provide standard PDB debugging.

var value = CompilationMode.OnlyRun;

CompilationMode.Dynamic

Compiles to a dynamic method for ordinary high-performance execution.

var value = CompilationMode.Dynamic;

Clone this wiki locally