name: contoso-migration-test description: "WORKFLOW SKILL — Execute end-to-end ContosoUniversity migration benchmark: clear output folder, run L1 script + L2 Copilot transforms, build, run Playwright acceptance tests, and generate a numbered run report. WHEN: "run contoso migration test", "test contoso university migration", "contoso migration benchmark", "run CU migration". INVOKES: migration-toolkit (scripts + skills), dotnet CLI, Playwright tests."
ContosoUniversity Migration Test
End-to-end migration benchmark that converts the ContosoUniversity Web Forms sample to Blazor Server and validates with 40 Playwright acceptance tests.
Paths
| Item | Path |
|---|---|
| Web Forms source | samples/ContosoUniversity/ContosoUniversity/ |
| Blazor output | samples/AfterContosoUniversity/ |
| L1 script | migration-toolkit/scripts/bwfc-migrate.ps1 |
| Migration skills | migration-toolkit/skills/ (4 skills) |
| Acceptance tests | src/ContosoUniversity.AcceptanceTests/ |
| Run reports | dev-docs/migration-tests/contosouniversity/ |
Prerequisites
- .NET 10 SDK
- SQL Server LocalDB with
ContosoUniversitydatabase (attachsamples/ContosoUniversity/ContosoUniversity.mdfif needed) - Playwright browsers installed (run
pwsh bin/Debug/net10.0/playwright.ps1 installfrom test project after first build)
Workflow
Phase 0: Preparation
- Determine run number — Count existing
runNNfolders indev-docs/migration-tests/contosouniversity/and use the next sequential number - Record start time — Capture wall-clock time for overall timing
- Clear output folder — Delete all contents of
samples/AfterContosoUniversity/but keep the directory itself
Phase 1: Layer 1 — Automated Script
Expected duration: < 2 seconds
- Start L1 timer
- Run the migration script:
.\migration-toolkit\scripts\bwfc-migrate.ps1 ` -Path samples\ContosoUniversity\ContosoUniversity ` -Output samples\AfterContosoUniversity ` -Verbose - Stop L1 timer — record duration and transform count from script output
- Verify:
.razorfiles created, no.aspxfiles in output
Phase 2: Layer 2 — Copilot-Assisted Transforms
Expected duration: 20–30 minutes
Load and apply the migration toolkit from migration-toolkit/:
- Read
migration-toolkit/README.mdfor the overall approach and key principles - Read
migration-toolkit/skills/— the toolkit contains all the skills needed for the repair phase; apply whichever skills are relevant to the errors and patterns encountered in the generated output
Key transforms to execute:
- Convert code-behind lifecycle (
Page_Load→OnInitializedAsync) - Wire
SelectMethodasSelectHandler<ItemType>delegates (NOTItems=) - Create EF Core
DbContextwith SQL Server LocalDB connection - Create
Program.cswith DI registration for all BLL services - Convert
Site.Master→MainLayout.razor - Migrate BLL classes to use EF Core + DI (
IDbContextFactory) - Wire all CRUD operations (Create, Read, Update, Delete) to UI
Phase 3: Build Validation
- Run
dotnet build samples\AfterContosoUniversity\ - Fix compilation errors iteratively until 0 errors achieved
- Record final error and warning counts
Phase 4: Acceptance Tests
- Start the Blazor app in the background:
$env:ASPNETCORE_URLS = "http://localhost:44380" dotnet run --project samples\AfterContosoUniversity\ - Wait for HTTP 200 from
http://localhost:44380 - Run acceptance tests:
$env:CONTOSO_BASE_URL = "http://localhost:44380" dotnet test src\ContosoUniversity.AcceptanceTests\ --verbosity normal - Record: total tests, passed, failed, skipped
- Stop the Blazor app
Phase 5: Report Generation
- Create
dev-docs/migration-tests/contosouniversity/runNN/ - Generate
REPORT.mdusing REPORT-TEMPLATE.md - All sections required — even failed runs get a full report
Critical Rules
| Rule | Detail |
|---|---|
| Database | SQL Server LocalDB — never SQLite |
| Connection | Server=(localdb)\mssqllocaldb;Database=ContosoUniversity |
| SelectMethod | Preserve as SelectHandler<ItemType> delegate — never convert to Items= |
| L1→L2 handoff | No manual fixes between layers — L2 starts from raw L1 output |
| Report every run | Even failed/partial runs get a report documenting what went wrong |
| ItemType | Use ItemType (not TItem) for all data-bound component type parameters |
Reference Documents
- REPORT-TEMPLATE.md — Standard report format with all required sections