---
name: ansight-migrate-sdk-1-1-dotnet
description: Migrate a .NET MAUI, .NET for Android, .NET for iOS, or Mac Catalyst app from an older Ansight pairing-config integration to SDK 1.1 zero-touch developer enrollment. Use when upgrading NuGet packages, deleting MSBuild pairing-resource generation or host settings, aligning native bridge packages, or adding generic physical-device QR enrollment.
---

# Migrate .NET and MAUI to Ansight SDK 1.1

Upgrade all managed and native bridge packages together, remove pairing-config
build plumbing, and use the native-backed zero-touch connection flow.

## Migration

1. Identify all Ansight package references, target frameworks, conditional
   development references, MAUI startup, native bridge packages, and pairing
   MSBuild targets.
2. Upgrade every Ansight package to `1.3.0-preview.10`. For MAUI:

```shell
dotnet add package Ansight.Maui --version 1.3.0-preview.10
```

   For non-MAUI apps, upgrade `Ansight` and any explicitly referenced
   `Ansight.*` packages to the same version.
3. Remove generated or embedded pairing JSON, `EmbeddedResource` entries,
   pairing-config MSBuild targets, host and Wi-Fi properties, build secrets,
   certificate inputs, and build-time desktop-host probes.
4. Remove code that reads or passes a pairing configuration. Do not keep a
   compatibility path.
5. For MAUI, initialize before `builder.Build()`:

```csharp
builder
    .UseMauiApp<App>()
    .UseAnsight<App>();
```

6. For a non-MAUI app, initialize the all-in-one runtime:

```csharp
var options = Options.CreateBuilder()
    .WithAnsightSdk()
    .Build();

Runtime.InitializeAndActivate(options);
```

7. Add a developer-only physical-device action:

```csharp
var result = await Runtime.HostConnection.ConnectAsync(
    HostConnectionRequest.QrCode());
```

8. Keep all-in-one and privileged tool packages conditional on the intended
   local-development build.

## Native bridge alignment

Do not pin a managed wrapper to one version and its Android or Apple binding to
another. Inspect the restored dependency graph and make sure all
`Ansight.Native.*`, `Ansight.Core`, `Ansight`, and `Ansight.Maui` assets resolve
to `1.3.0-preview.10`.

## Enrollment behavior and permissions

Android emulators, iOS Simulator, and Mac Catalyst connect automatically to a
running CLI host. Physical devices scan the QR from `ansight pairing issue
<app-id> --qr` once and reconnect from app-private registration state.

Android needs no app camera permission for the SDK scanner. iOS requires
`NSCameraUsageDescription` when scanning and `NSLocalNetworkUsageDescription`
for direct device access. Add no unrelated permissions or ATS exception.

## Verification

Run restore, build, and relevant tests for every target framework changed:

```shell
dotnet restore
dotnet build
dotnet test
```

Inspect the app bundle or package to confirm no pairing JSON is embedded.
Launch twice with `ansight host run` active and verify automatic reconnect with
`ansight session list --connected --app-id <app-id> --json`. Exercise one
terminal QR enrollment on each physical platform in scope.
