Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording
0.7.0
Prefix Reserved
dotnet add package Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording --version 0.7.0
NuGet\Install-Package Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording -Version 0.7.0
<PackageReference Include="Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording" Version="0.7.0" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording" Version="0.7.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording" />
paket add Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording --version 0.7.0
#r "nuget: Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording, 0.7.0"
#:package Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording@0.7.0
#addin nuget:?package=Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording&version=0.7.0
#tool nuget:?package=Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording&version=0.7.0
Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording
Record a Windows app window — or one element's region — to an H.264 MP4, with optional timestamped
JPEG frames for evidence. This is the recording engine behind winapp ui record.
This package does not coordinate with other automation on the desktop. The
winappCLI layers cooperative desktop turns on top of this engine — holding the desktop while a recording starts, and for the whole recording when the host falls back to PrintWindow capture. That arbitration lives in the CLI, not here. Code calling these APIs directly does not participate in it: it is outside that guarantee and is responsible for serializing itself against any other automation running at the same time, or for running on a desktop nothing else is driving. This matters most forRecordOptions.CaptureScreen, where anything another workflow does lands in the video.
dotnet add package Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording
dotnet add package Microsoft.Extensions.DependencyInjection
dotnet add package Microsoft.Extensions.Logging
using Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation;
using Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection()
.AddLogging()
.AddWinAppUiAutomation()
.AddWinAppUiRecording()
.BuildServiceProvider();
var resolver = services.GetRequiredService<IUiTargetResolver>();
var recorder = services.GetRequiredService<IUiRecordingService>();
var target = await resolver.ResolveAsync("notepad", hwnd: null, CancellationToken.None);
var result = await recorder.RecordAsync(target, elementId: null, new RecordOptions
{
OutputPath = "session.mp4",
DurationSec = 10,
Fps = 10,
MaxEdge = 1280,
}, CancellationToken.None);
Console.WriteLine($"{result.Frames} frames, {result.Width}x{result.Height}, mode {result.Mode}");
Why this is a separate package
Recording needs SkiaSharp for frame scaling and JPEG output, whose native binary adds roughly 13 MB
per architecture. Splitting it out keeps
Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation small for the many projects that only need to
inspect and drive UI. Reference this package only when you actually want video.
Capture modes
RecordAsync picks a capture path and reports it as RecordCaptureResult.Mode:
wgc— Windows Graphics Capture. The default, and the only one that reliably captures occluded or GPU-composited windows.printwindow— GDI fallback when Graphics Capture is unavailable.screen— screen-DC capture, used when you setRecordOptions.CaptureScreen. This is the only mode that includes popups and overlays drawn outside the window, and it captures whatever is on screen — including other windows on top.
Set RecordOptions.FramesDirectory to also write a frame bundle: numbered JPEGs, a frames.ndjson
index, and a manifest.json describing the run.
Whole-desktop recording
Call IUiRecordingService.RecordDesktopAsync(options, cancellationToken) to record the calling
process's entire virtual desktop without activating or restoring any window. Leave the
window-specific CaptureScreen option false. The mode is screen; the caller
must be per-monitor DPI aware and attached to the current interactive input desktop.
The result's Coordinates and the frame manifest's coordinates map both MP4 and JPEG pixels
back to screen input coordinates. They include the source origin, scaling and encoder padding;
use CaptureCoordinates.ToScreenPoint for individual image points. A display-bounds change ends
the recording with display_changed; loss of the input desktop ends it with capture_unavailable.
Both finalize already captured evidence and mark the frame manifest partial. Cancellation after
capture starts finalizes with cancelled.
Requirements
Windows 10 version 2004 (build 19041) or later, and a target framework of
net10.0-windows10.0.19041.0. Both Graphics Capture and the Media Foundation H.264 encoder need the
Windows 10 SDK projection, so this package does not offer a leaner target.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.19041 is compatible. |
-
net10.0-windows10.0.19041
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation (= 0.7.0)
- SkiaSharp (>= 4.152.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.0 | 43 | 9/24/2026 |
| 0.6.3-prerelease.90 | 51 | 9/23/2026 |
| 0.6.3-prerelease.88 | 47 | 9/23/2026 |