dotnet-47-to-8-recipe
A workflow recipe that daisy-chains the .NET 4.7 → .NET 8 codemods.
For an example migration using this recipe, check out this blog post.
Contact us to get access to this codemod bundle.
Steps
dotnet-sdk-style-netfx— legacy.csproj→ SDK-style.dotnet-packagereference-migrate—packages.config→PackageReference.dotnet-lib-multitarget-net8— addnet8.0to eligible SDK-style projectTargetFrameworks.dotnet-aspnetcore-endpoints— Web API 2 controllers → ASP.NET Core.dotnet-portable-framework-apis— replace framework-only APIs (HttpUtility → WebUtility, etc.).dotnet-efcore-port— EF Core DbContext constructor scaffolding.dotnet-owin-host-to-minimalapi— OWIN self-host (WebApp.Start<Startup>,Microsoft.Owin.Testing) → ASP.NET Core minimal API host andWebApplicationFactory.dotnet-appconfig-to-appsettings—App.config/Web.config→appsettings.json(appSettings+connectionStrings), drop<entityFramework>,<startup>, and<runtime>/<assemblyBinding>sections that no longer apply on .NET 8.dotnet-net8-cutover— collapse to<TargetFramework>net8.0</TargetFramework>/net8.0-windowsand strip#if NET8_0branches.dotnet-framework-facade-cleanup— remove framework-provided facade packages and bare framework references after cutover.dotnet-runtime-config-cleanup— remove remaining framework-only<startup>/<runtime>config sections.dotnet-winforms-bootstrap-modernize— replace legacy WinForms bootstrap calls withApplicationConfiguration.Initialize().
The published generic chain is ordered as: 1 → 2 → 3 → 4 → 5 → 6 → 7 → 8 → 9 → 10 → 11 → 12.
Run
bash
Local Workflow Variant
For local end-to-end testing against the workspace packages, use
workflow.local.yaml. It points at the local package
directories instead of registry package names, but it now carries the same
12-step chain as the published workflow.
Smoke test the local chain with:
bash
Run the local chain against the real rdp-portal checkout with:
bash
A small smoke fixture lives under smoke/workflow-input/ that mirrors an OWIN/EF6 ApiHost shape (similar to dot-net-4-demo's DemoApp.Legacy.ApiHost). To exercise every node in the chain against the fixture:
bash
which expands to:
bash
The workflow order keeps declaration migration before final cutover, then runs
post-cutover cleanup and desktop-specific bootstrap modernization.