Ansight.Pairing 0.1.0-pre3

This is a prerelease version of Ansight.Pairing.
dotnet add package Ansight.Pairing --version 0.1.0-pre3
                    
NuGet\Install-Package Ansight.Pairing -Version 0.1.0-pre3
                    
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="Ansight.Pairing" Version="0.1.0-pre3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ansight.Pairing" Version="0.1.0-pre3" />
                    
Directory.Packages.props
<PackageReference Include="Ansight.Pairing" />
                    
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 Ansight.Pairing --version 0.1.0-pre3
                    
#r "nuget: Ansight.Pairing, 0.1.0-pre3"
                    
#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 Ansight.Pairing@0.1.0-pre3
                    
#: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=Ansight.Pairing&version=0.1.0-pre3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Ansight.Pairing&version=0.1.0-pre3&prerelease
                    
Install as a Cake Tool

Ansight.Pairing

Ansight.Pairing adds package-owned native pairing acquisition to Ansight.

It provides:

  • native QR scanning for HostConnectionRequest.QrCode(...)
  • Android scanner acquisition via the current Activity and native Apple modal presentation
  • a default IHostConnectionConfigReader wired into the existing runtime-owned host connection flow

Developer pairing is generated by the base Ansight package. Enable AnsightDeveloperPairingEnabled in the app project, then configure WithBundledHostConnection(...); Ansight.Pairing only adds the native QR acquisition path used by explicit overrides.

Usage

using Ansight;
#if ANDROID
using Microsoft.Maui.ApplicationModel;
#endif

var optionsBuilder = Options.CreateBuilder()
    .WithBundledHostConnection(typeof(AppBootstrap).Assembly);

#if ANDROID
optionsBuilder = optionsBuilder.WithPlatformPairing(() => Platform.CurrentActivity);
#else
optionsBuilder = optionsBuilder.WithPlatformPairing();
#endif

var options = optionsBuilder.Build();

Runtime.InitializeAndActivate(options);

On Android, Ansight.Pairing requires the app to provide the current Activity so the package can launch the native scanner UI.

Once enabled, the app can keep using the existing host connection requests:

await Runtime.HostConnection.ConnectAsync(HostConnectionRequest.Auto());
await Runtime.HostConnection.ConnectAsync(HostConnectionRequest.QrCode());
await Runtime.HostConnection.ConnectAsync(HostConnectionRequest.PayloadText(payload));

Auto() still follows the normal Ansight default order: embedded developer pairing, cached session, saved config, then plain bundled config. Explicit QR and payload requests always override the current connection attempt.

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net10.0-android was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed. 
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.1.0-pre3 37 4/21/2026