Ansight.OfflineCapture
1.0.2-preview.3
dotnet add package Ansight.OfflineCapture --version 1.0.2-preview.3
NuGet\Install-Package Ansight.OfflineCapture -Version 1.0.2-preview.3
<PackageReference Include="Ansight.OfflineCapture" Version="1.0.2-preview.3" />
<PackageVersion Include="Ansight.OfflineCapture" Version="1.0.2-preview.3" />
<PackageReference Include="Ansight.OfflineCapture" />
paket add Ansight.OfflineCapture --version 1.0.2-preview.3
#r "nuget: Ansight.OfflineCapture, 1.0.2-preview.3"
#:package Ansight.OfflineCapture@1.0.2-preview.3
#addin nuget:?package=Ansight.OfflineCapture&version=1.0.2-preview.3&prerelease
#tool nuget:?package=Ansight.OfflineCapture&version=1.0.2-preview.3&prerelease
Ansight.OfflineCapture
Offline capture storage, retention, runtime mutation, and ZIP export support for Ansight .NET apps.
using Ansight.OfflineCapture;
var offlineCapture = OfflineCapture.Configure(new OfflineCaptureOptions
{
RootDirectory = ".ansight",
MaximumSessionBytes = 128 * 1024 * 1024
});
await offlineCapture.InitializeAsync();
await offlineCapture.StartAsync();
await offlineCapture.UpdateOptionsAsync(options =>
{
options.RetentionWindowOverride = TimeSpan.FromSeconds(30);
options.SessionJpegCaptureEnabledOverride = false;
});
await offlineCapture.ExportToFileAsync("capture.zip", new OfflineCaptureExportOptions
{
Password = "optional-password"
});
await offlineCapture.StopAsync();
Data is written as compact JSONL in .ansight/sessions/{sessionId} with minified property names and append-only segment files. Offline capture uses the runtime retention period and SessionJpegCapture settings by default. Use the override properties only when offline capture needs behavior different from the active runtime configuration.
Important: Offline screenshot capture will result in an FPS drop while frames are captured and encoded. Disable
SessionJpegCaptureor setSessionJpegCaptureEnabledOverride = falsefor performance-focused runs unless visual evidence is required.
Activation
Disabled: no automatic start.Immediate: starts capture now and persistsDisabledfor future sessions.NextSessionOnly: persists a future one-shot start. DuringInitializeAsync, capture starts and the persisted mode is cleared without stopping the active capture.AlwaysOn: starts capture for every app session until disabled.
The controller supports runtime mutation through UpdateOptionsAsync(Action<OfflineCaptureOptions>). ActivationMode, retention limits, segment duration, and session JPEG overrides are mutable while capture is active. RootDirectory and MaximumQueuedRecords affect active writer ownership and queue construction, so changing either requires stopping capture first.
Storage Layout
.ansight/
settings.json
sessions/
{sessionId}/
manifest.json
metadata/
channels.json
device-profile.json
custom-properties.json
telemetry/
metrics/
m-{utc}.jsonl
events/
e-{utc}.jsonl
input/
touches/
t-{utc}.jsonl
screenshots/
{utc}.jpg
index/
s-{utc}.jsonl
settings.json, manifest.json, and metadata/*.json are compact metadata files. High-volume data files are append-only JSONL segments. Metric, event, touch, and screenshot index records use minified JSON with short property names and no formatted whitespace.
Retention is enforced during startup, active writes, runtime option updates, and export preparation. Time retention deletes closed files older than the effective retention window; active writer files are never deleted. MaximumSessionBytes trims old closed files inside the active session, and MaximumRetainedBytes trims old closed files across .ansight.
Export
The SDK supports both file and stream export:
ExportToFileAsync(path, options)writes a ZIP file and returns the file path.ExportToStreamAsync(stream, options)writes a ZIP to a caller-provided stream.OfflineCaptureExportOptions.Passwordenables AES-256 entry encryption through SharpZipLib on currentnet9.0targets.- Without a password, export uses
System.IO.Compression.ZipArchive.
ZIP exports stream the raw .ansight session files directly. Export does not expand the captured JSONL into Studio archive JSON; Studio ingests the minified JSONL capture format directly. IncludeStudioSessionArchive and IncludeRawCaptureFiles are retained for source compatibility, but export no longer expands JSONL capture files into Studio-native aggregate JSON.
Samples
The primary manual test app is src/dotnet/samples/Ansight.OfflineCapture.MauiSample. It exercises capture activation, runtime mutation, touch/screenshot capture, lifecycle events, custom session properties, and ZIP export from a real .NET MAUI app.
Run the local desktop target with:
dotnet build src/dotnet/samples/Ansight.OfflineCapture.MauiSample -f net9.0-maccatalyst
dotnet run --project src/dotnet/samples/Ansight.OfflineCapture.MauiSample -f net9.0-maccatalyst
A console smoke sample is also available at src/dotnet/samples/Ansight.OfflineCapture.Sample:
dotnet run --project src/dotnet/samples/Ansight.OfflineCapture.Sample
dotnet run --project src/dotnet/samples/Ansight.OfflineCapture.Sample -- --password=secret
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-android35.0 is compatible. net9.0-browser was computed. net9.0-ios was computed. net9.0-ios18.0 is compatible. net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 is compatible. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Ansight.Core (>= 1.0.2-preview.3)
- SharpZipLib (>= 1.4.2)
-
net9.0-android35.0
- Ansight.Core (>= 1.0.2-preview.3)
- SharpZipLib (>= 1.4.2)
-
net9.0-ios18.0
- Ansight.Core (>= 1.0.2-preview.3)
- SharpZipLib (>= 1.4.2)
-
net9.0-maccatalyst18.0
- Ansight.Core (>= 1.0.2-preview.3)
- SharpZipLib (>= 1.4.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Ansight.OfflineCapture:
| Package | Downloads |
|---|---|
|
Ansight
All-in-one Ansight SDK package for .NET apps, including core runtime, pairing, and remote tools. |
|
|
Ansight.Maui
All-in-one Ansight SDK package for .NET MAUI apps, including core runtime, pairing, remote tools, automatic lifecycle and page-view telemetry, and MAUI inspection tools. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2-preview.3 | 49 | 7/7/2026 |
| 1.0.2-preview.2 | 67 | 7/6/2026 |
| 1.0.2-preview.1 | 60 | 6/30/2026 |