.NET

Install the Ansight .NET SDK, initialize the runtime, and branch into screen views, telemetry, app lifecycle, pairing, configuration, and remote tool suites including live reflection.

The .NET SDK is the current primary Ansight runtime integration.

Supported Targets

The base package targets:

  • net9.0
  • net9.0-android
  • net9.0-ios
  • net9.0-maccatalyst

Package id:

Ansight

Install the Base Package

dotnet add package Ansight

Or add it directly in the project file:

<ItemGroup>
  <PackageReference Include="Ansight" Version="*" />
</ItemGroup>

Minimal Runtime Setup

using Ansight;

var options = Options.CreateBuilder()
    .WithFramesPerSecond()
    .Build();

Runtime.InitializeAndActivate(options);

That gives you the runtime, the built-in telemetry surfaces, and the host pairing surface.

What the Base Package Covers

The base package includes:

  • sampling and retention configuration
  • built-in memory and FPS metrics
  • screen-view and lifecycle events
  • runtime log callbacks
  • custom channels
  • optional session JPEG capture
  • runtime-owned host pairing and reconnection
  • tool registration and tool guard policy

Common Next Steps

  • Use Pairing to connect the app to Studio.
  • Use Configuration to tune sampling, capture, and pairing behavior.
  • Use Performance Telemetry to capture built-in FPS and memory metrics.
  • Use Screen Views to record page and screen navigation events.
  • Use Capturing Logs to capture runtime logs and receive third-party logs into Ansight.
  • Use App Lifecycle to track foreground and background transitions.
  • Use Tools to add VisualTree, reflection, database, file-system, preferences, or secure-storage suites.

Tool Packages

Warning: Keep tool packages scoped to local development builds only.

Install tool packages separately. The base package owns the tool abstractions, but the concrete tools ship in independent packages.

Examples:

dotnet add package Ansight.Tools.VisualTree
dotnet add package Ansight.Tools.Reflection
dotnet add package Ansight.Tools.Database

Available tool packages: