---
name: binary-dll-migration
description: Use when source is unavailable and a managed WPF, WinUI, Avalonia, DLL, or EXE must be inventoried, decompiled, analyzed, or staged for migration.
---

# Binary DLL Migration

Use this skill for source-unavailable managed `.dll` or `.exe` inputs.

## Workflow

1. Confirm the input is a managed assembly. The CLI reports unreadable/native binaries without mutating them.

2. Run direct analysis. Direct DLL/EXE inputs are decompiled automatically:

```bash
dotnet run --project src/MigrateToWinUI.Cli -- analyze <assembly.dll> --source auto --target both --format json --report out/binary/analysis.json
```

3. For artifact-producing runs, use `decompile`:

```bash
dotnet run --project src/MigrateToWinUI.Cli -- decompile <assembly.dll> --source wpf --target winui3 --out out/binary/decompiled --report out/binary/report.json --preview out/binary/preview.txt
```

4. Include local UI references only when you need referenced application libraries:

```bash
dotnet run --project src/MigrateToWinUI.Cli -- decompile <assembly.dll> --include-references --source wpf --target both --out out/binary/full
```

## Review Gates

- Framework/reference assemblies are skipped.
- BAML resources are manual-review and must not produce safe XAML rewrite claims.
- Decompiled locations are synthetic unless backed by original PDB/source evidence.
- Decompiler warnings, unresolved references, and resource extraction notes are migration findings.

## Outputs

- Decompiled C# projection files.
- Recovered loose XAML/resources when possible.
- `decompilation-manual-review.md`.
- Migration report and optional rewrite preview.
