Skip to main content
NSP’s CLR probe attaches to any running .NET process — WinForms apps, WPF apps, .NET 4.x / .NET 6+ binaries — using the Windows CLR Hosting API. No code changes to the target application are required. This guide uses Mission Planner (a C# ground control station) as the worked example, but the same patterns apply to any .NET app.

How the CLR Probe Works

When the NSP daemon detects a .NET process, it injects a managed C# bridge assembly into the target AppDomain via the CLR Hosting API. The bridge runs inside the target process and communicates back to the daemon through a Memory-Mapped File (MMF). This design means:
  • No process restart required — injection happens while the app is running.
  • Zero-copy communication — the MMF is shared memory; no serialization overhead.
  • Non-intrusive field reads — field values are read through managed reflection without pausing the JIT.

Prerequisites

.NET App Running

The target .NET application must already be running. The daemon detects it automatically within one scan cycle (default: 5 seconds).

NSP Daemon Running

Run axon-daemon.exe run or start the Windows Service. Ensure the daemon has permission to inject into the target process (run both as the same user, or as Administrator).

SDK Installed

pip install nelieo-nsp

No App Changes

You do not need to modify, rebuild, or restart the target .NET application.

Step 1 — Verify Detection

List tracked apps and check for your .NET process. The runtime field will be clr for any managed .NET target:
CLR confidence baselines typically start at 0.70–0.80 during the first probe while the bridge enumerates assembly types. Confidence reaches 0.95+ once the semantic engine has mapped the major state fields. This usually takes 15–45 seconds after the process is first detected.

Step 2 — Attach and Read Normalized State

The CLR probe normalizes extracted fields into the standard NSP state tree (SSF format). Use the same typed accessors you would with any other app:

Step 3 — Read .NET Fields Directly via session.clr

When normalized state doesn’t cover what you need, use session.clr — a CLRSessionProxy that gives you direct access to the CLR heap:

Step 4 — Invoke .NET Methods via session.clr

Call any public .NET method with typed arguments. Python values are automatically coerced to the matching .NET parameter types:
Python bool, int, float, str, and list all coerce automatically to their .NET equivalents. Strings in ISO 8601 format coerce to DateTime; GUID-formatted strings coerce to Guid. Enums can be passed by name as a string.

Step 5 — Execute NSP Actions

The CLR probe also exposes higher-level NSP actions discovered from the app’s schema. Use session.execute() for these:

Step 6 — Stream Telemetry in Real Time

Complete Example — Autonomous Waypoint Mission

CLR Proxy Method Reference

Reads a single field from the first matching instance of type_name on the CLR heap.
Reads multiple fields in a single MMF round-trip. Returns a dict[str, Any].
Invokes a method on the first matching instance. Returns the method’s return value, coerced back to a Python type.
Walks the CLR heap and returns a list of objects whose type names start with include_prefix. Each object contains type_name and fields keys. This is an expensive operation — use sparingly.