Skip to content

API Host ScriptModule

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

ScriptModule

Runtime metadata for a compiled module

Back to .NET Host API Reference

Overview

ScriptModule is the module object, usually obtained from ScriptDomain.GetModule or function metadata. It is primarily for diagnostics, path handling, and advanced host integration.

Properties

Name

string Name

Returns

Module name declared by @module.

// Given an initialized ScriptDomain named domain:
var module = domain.GetModule("MAIN");
Console.WriteLine(module.Name); // MAIN

ModulePath

Resolver-relative module path.

string ModulePath

Returns

Resolver-relative module path.

// Given an initialized ScriptDomain named domain:
var module = domain.GetModule("MAIN");
Console.WriteLine(module.ModulePath);

FullPath

Normalized absolute file path or virtual full path of the module source.

string FullPath

Returns

Absolute or virtual full path of the source.

// Given an initialized ScriptDomain named domain:
var module = domain.GetModule("MAIN");
Console.WriteLine(module.FullPath);

Clone this wiki locally