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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
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"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation.Recording&version=0.7.0
                    
Install as a Cake Tool

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 winapp CLI 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 for RecordOptions.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 set RecordOptions.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 Compatible and additional computed target framework versions.
.NET net10.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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