-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ClrInstanceObject
Liu.Yandong.Hanks edited this page Aug 21, 2026
·
3 revisions
ScriptObject wrapper around a CLR object instance.
Namespace: AuroraScript.Runtime.Interop. Kind: class.
Back to .NET Host API Reference
ClrInstanceObject is how a live CLR instance appears inside the script runtime. Member access on the script side is routed to the wrapped object, and a host can recover the original instance through Instance.
Note
Hosts commonly receive this when ClrMarshaller wraps a registered CLR object.
A minimal use of ClrInstanceObject.
var result = domain.Execute("MAIN", "create");
if (result.Object is ClrInstanceObject wrapper)
{
Console.WriteLine(wrapper.Instance);
}object InstanceWrapped CLR object.
Parameters
None.
Returns
Returns object.
Behavior
Cast Instance to the expected host type before use; the wrapper does not validate the target type on the host's behalf.
if (result.Object is ClrInstanceObject wrapper &&
wrapper.Instance is HostCalculator calculator)
{
Console.WriteLine(calculator.Total);
}AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License