A small app with every classic .NET Framework trap in it. Worth moving incrementally - after two decisions: how sign-in and the session cart work while both apps run.
Recommended path: Port to .NET 10 incrementally (strangler fig): new ASP.NET Core host with YARP in front, System.Web adapters for shared code, CoreWCF for the inventory service, EF 6.5 as a bridge before EF Core.
Nothing blocks the move for good: the 4 hard blockers (HttpContext.Current in a library, BinaryFormatter, the WCF server, System.Web in a library) all have known fixes. The risk is behavior, not code - 9 pricing and cart quirks that customers see. Lock them with parity tests before touching anything, then move the read-only pages and the API first.
flowchart LR
browser(["Browser / API clients"])
nLegacyShopCore["LegacyShop.Core<br/><small>class library · v4.8 · 128 LOC</small>"]
nLegacyShopData["LegacyShop.Data<br/><small>class library · v4.8 · 304 LOC</small>"]
nLegacyShopInventory["LegacyShop.Inventory<br/><small>WCF service · v4.8 · 89 LOC</small>"]
nLegacyShopWeb["LegacyShop.Web<br/><small>ASP.NET web app · v4.8 · 6 pages, 3 controllers</small>"]
browser --> nLegacyShopWeb
nLegacyShopInventory --> nLegacyShopData
nLegacyShopWeb --> nLegacyShopCore
nLegacyShopWeb --> nLegacyShopData
db[("SQL database<br/><small>EF6</small>")]
nLegacyShopData --> db
nLegacyShopWeb -. SOAP .-> nLegacyShopInventory
classDef old fill:#eee,stroke:#999,color:#333;
flowchart LR
browser(["Browser / API clients"])
subgraph host["ASP.NET Core on .NET 10"]
nRazorPages["Razor Pages<br/><small>5 pages</small>"]
nBlazorInteractiveServer["Blazor (Interactive Server)<br/><small>1 page</small>"]
api["API controllers<br/><small>2 from Web API 2</small>"]
mvc["MVC controllers + view components<br/><small>1 from MVC 5</small>"]
mw["Middleware + endpoints<br/><small>2 modules/handlers</small>"]
end
corewcf["CoreWCF service<br/><small>same SOAP contract</small>"]
nLegacyShopCore["LegacyShop.Core<br/><small>net10.0</small>"]
nLegacyShopData["LegacyShop.Data<br/><small>net10.0</small>"]
db[("SQL database<br/><small>EF Core</small>")]
browser --> host
host --> nLegacyShopCore
host --> nLegacyShopData
host -. SOAP .-> corewcf
host --> db
Nothing is rewritten in one go. A new .NET 10 app sits in front of the old one. Every request it can already handle stays in the new app; everything else falls through to the old app. One route at a time moves over - after parity tests prove the new route answers like the old one.
flowchart LR
browser(["Browser / API clients"]) --> yarp
subgraph newapp["New .NET 10 app"]
yarp{"YARP<br/><small>route already migrated?</small>"}
done["Migrated routes<br/><small>tested with parity tests</small>"]
end
subgraph oldapp["Old app (.NET Framework)"]
legacy["LegacyShop.Web<br/><small>everything not migrated yet</small>"]
end
yarp -- yes --> done
yarp -- no / fallback --> legacy
done -. "remote session + remote auth<br/>(System.Web adapters)" .-> legacy
style done fill:#e3f5ea,stroke:#2d7a52,color:#14361f
style legacy fill:#f1f1f1,stroke:#999,color:#333
gantt dateFormat YYYY-MM-DD axisFormat %d %b excludes weekends section With an AI agent (1 developer) Decisions :p0, 2026-11-30, 3d Safety net (tests first) :p1, after p0, 3d Foundations - projects, packages, libraries :p2, after p1, 2d New .NET 10 host + YARP :p3, after p2, 2d Migrate slice by slice :p4, after p3, 7d Auth, session and cross-cutting code :p5, after p4, 3d Rollout and shut down the old app :p6, after p5, 3d
| Page | Size | Target | Why | Hours |
|---|---|---|---|---|
Cart.aspx | M | Razor Pages | Uses session state, and interactive Blazor has no HttpContext or session. Postback handlers map to Razor Pages handlers. Uses session (directly or through a helper). Human: Decide whether the stored order total should include coupon, shipping and VAT (quirk Q4) | 4-8 |
Product.aspx | M | Razor Pages | Uses session state, and interactive Blazor has no HttpContext or session. Keep it a page; replace the UpdatePanel with a small fetch to a page handler. Keeps data in ViewState (6 uses) - make that state explicit. Uses session (directly or through a helper). UpdatePanel partial postbacks. Human: Decide whether 'Add to cart' keeps the price from page load (quirk Q3) | 4-8 |
Site.Master | S | Layout (+ view component) | Master pages become a shared layout; code-behind logic moves into a view component or partial. Uses session (directly or through a helper). | 1-2 |
Default.aspx | M | Razor Pages | List/form page: postback handlers map to Razor Pages handlers, GET pages stay linkable and cacheable. Keeps data in ViewState (2 uses) - make that state explicit. | 4-8 |
Error.aspx | S | Razor Pages | List/form page: postback handlers map to Razor Pages handlers, GET pages stay linkable and cacheable. | 2-4 |
Admin/Products.aspx | L | Blazor (Interactive Server) | Heavy in-page interactivity (inline grid editing, 5 postback handlers) maps to components better than to page handlers. Talks to the database from code-behind - extract a service first. Human: Confirm Blazor is fine for the admin area (only admins use it) | 10-18 |
Controls/MiniCart.ascx | S | View component (Razor Pages) or Blazor component | Pick the same technology as the pages that host it. Uses session (directly or through a helper). | 1-2 |
Account/Login.aspx | S | Razor Pages | Signs users in/out or writes cookies - needs a real HTTP request, which interactive Blazor doesn't have. | 2-4 |
| Unit | Kind | Size | Target | Without AI | With AI |
|---|---|---|---|---|---|
LegacyShop.CoreLegacyShop.Core/LegacyShop.Core.csproj References System.Web - needs Microsoft.AspNetCore.SystemWebAdapters or an abstraction. | library | S | netstandard2.0 or net10.0 (multi-target during the move) | 2-4 h | 1-1 h |
ShopContextLegacyShop.Data/ShopContext.cs Lazy loading via virtual navigations - EF Core needs Include or proxies. Database initializer + Seed - no EF Core equivalent. Human: Decide Restrict vs Cascade for Product -> OrderLine | ef-context | S | EF 6.5 on .NET 10 first, then EF Core | 7-16 h | 3-8 h |
LegacyShop.DataLegacyShop.Data/LegacyShop.Data.csproj | library | S | netstandard2.0 or net10.0 (multi-target during the move) | 2-4 h | 1-1 h |
IInventoryServiceLegacyShop.Inventory/IInventoryService.cs | wcf-service | S | CoreWCF (same contract) | 4-9 h | 2-4 h |
Handlers/ProductImage.ashxLegacyShop.Web/Handlers/ProductImage.ashx | http-handler | S | Minimal API endpoint or middleware | 1-3 h | 0-1 h |
Global.asaxLegacyShop.Web/Global.asax.cs Events: Application_Start, Session_Start, Session_End, Application_PostAuthenticateRequest, Application_Error. Session_End has no ASP.NET Core equivalent. | global-asax | M | Program.cs + middleware | 3-6 h | 1-3 h |
ProductsControllerLegacyShop.Web/Api/ProductsController.cs | webapi-controller | M | ASP.NET Core controller | 3-6 h | 1-3 h |
OrdersControllerLegacyShop.Web/Api/OrdersController.cs Uses HttpContext.Current (directly or through a helper). Human: Accept 401 instead of 302 for unauthenticated calls | webapi-controller | S | ASP.NET Core controller | 1-3 h | 0-1 h |
ReportsControllerLegacyShop.Web/Controllers/ReportsController.cs Child actions become view components. [OutputCache] -> ASP.NET Core output caching middleware. | mvc-controller | S | ASP.NET Core MVC controller + views | 3-6 h | 1-3 h |
RequestTimingModuleLegacyShop.Web/Modules/RequestTimingModule.cs | http-module | S | Middleware | 1-3 h | 0-1 h |
| Safety net: parity + characterization tests Human: Decide what "the same behavior" means (which differences are OK); Review the recorded requests and the normalization rules | Tests and proof | 18-45 h | 7-18 h | ||
| New .NET 10 host with YARP + System.Web adapters Human: Hosting decision (IIS, containers, cloud); Routing and TLS in front of both apps | Hosting and rollout | 8-16 h | 6-12 h | ||
| Authentication & authorization design Human: Cookie auth vs Identity vs external IdP; Shared sign-in while both apps run (remote auth); Role and policy model | Decisions | 4-8 h | 4-8 h | ||
| Authentication & authorization implementation Human: Test sign-in, sign-out and expiry in both apps | Translating code | 8-16 h | 4-8 h | ||
| Session state strategy Human: Keep session (remote/distributed) or remove it; What lives in session today and why | Decisions | 2-4 h | 2-4 h | ||
| Session state implementation | Translating code | 4-8 h | 2-4 h | ||
| Configuration: web.config -> appsettings + Options Human: Where secrets live in production | Mechanical changes | 2-5 h | 1-2 h | ||
| machineKey -> Data Protection key ring Human: Key storage and rotation | Decisions | 2-6 h | 2-6 h | ||
| Replace BinaryFormatter Human: Check that existing serialized data can be read or safely dropped | Translating code | 2-6 h | 1-3 h | ||
| Image processing without System.Drawing Human: Windows hosting vs ImageSharp/SkiaSharp (licenses!) | Decisions | 2-4 h | 2-4 h | ||
| Port image code | Translating code | 4-8 h | 2-4 h | ||
| WCF clients: config -> code | Translating code | 2-4 h | 1-2 h | ||
| Static assets and bundling | Mechanical changes | 2-4 h | 1-1 h | ||
| SDK-style projects + PackageReference + CPM | Mechanical changes | 4-8 h | 1-3 h | ||
| Deployment, CI/CD and rollout Human: Release plan, monitoring, rollback; Who signs off each switched route | Hosting and rollout | 8-20 h | 6-16 h | ||
| Remove YARP fallback + adapters, shut down the old app Human: Final go/no-go | Hosting and rollout | 2-4 h | 2-3 h | ||
| Total | M | 128-280 h | 68-149 h |
| Severity | Signal | Hits | What it means / the fix | Where |
|---|---|---|---|---|
| hard | HttpContext.Current | 9 | Static access to the request - not available in ASP.NET Core. Fix: IHttpContextAccessor / pass the user in; System.Web adapters while both apps run. | LegacyShop.Core/CurrentUser.csLegacyShop.Web/Api/OrdersController.csLegacyShop.Web/Infrastructure/CartSession.cs |
| hard | System.Web in a library | 2 | Class library compiled against System.Web. Fix: Microsoft.AspNetCore.SystemWebAdapters, then remove. | LegacyShop.Core/CurrentUser.cs |
| hard | BinaryFormatter | 3 | Removed in .NET 9+ and insecure. Fix: System.Text.Json / MessagePack / protobuf. | LegacyShop.Web/Infrastructure/DiskCache.cs |
| hard | WCF service (server) | 1 | No WCF server in .NET 10. Fix: CoreWCF (same contract) or gRPC/REST. | LegacyShop.Inventory/IInventoryService.cs |
| medium | ViewState | 8 | WebForms page state. Fix: Explicit state: hidden fields, query string, component state. | LegacyShop.Web/Product.aspx.csLegacyShop.Web/Default.aspx.cs |
| medium | UpdatePanel | 1 | Partial postbacks. Fix: Blazor interactivity or a small fetch + partial. | LegacyShop.Web/Product.aspx |
| medium | Session state | 2 | InProc session with objects. Fix: ASP.NET Core session (serialized) or a store; remote session while both apps run. | LegacyShop.Web/Global.asax.csLegacyShop.Web/Infrastructure/CartSession.cs |
| medium | Forms authentication | 7 | Forms auth cookie and ticket. Fix: ASP.NET Core cookie auth / Identity; remote authentication during the move. | LegacyShop.Web/Site.Master.csLegacyShop.Web/Web.configLegacyShop.Web/Account/Login.aspx.cs |
| medium | machineKey | 1 | Shared keys for cookies and ViewState. Fix: Data Protection; shared key ring if cookies must work in both apps. | LegacyShop.Web/Web.config |
| medium | IHttpModule | 2 | HTTP module in the IIS pipeline. Fix: Middleware. | LegacyShop.Web/Modules/RequestTimingModule.cs |
| medium | IHttpHandler / .ashx | 2 | Custom HTTP handler. Fix: Endpoint / middleware. | LegacyShop.Web/Handlers/ProductImage.ashx.cs |
| medium | System.Drawing | 2 | GDI+ - Windows-only on .NET 6+. Fix: ImageSharp / SkiaSharp, or stay on Windows hosting. | LegacyShop.Web/Handlers/ProductImage.ashx.cs |
| medium | ConfigurationManager | 5 | Reads Web.config / App.config. Fix: IConfiguration + IOptions. | LegacyShop.Core/AppSettings.cs |
| medium | WCF client config | 4 | WCF client built from system.serviceModel config. Fix: System.ServiceModel.* NuGet packages; endpoint and binding in code. | LegacyShop.Web/Web.Release.configLegacyShop.Web/Web.configLegacyShop.Web/Services/InventoryClient.cs |
| medium | Global.asax | 1 | Application lifecycle events. Fix: Program.cs, middleware, hosted services. | LegacyShop.Web/Global.asax.cs |
| medium | EF6-only APIs | 6 | APIs that don't exist in EF Core. Fix: EF Core equivalents (HasOne, .Date, ...). | LegacyShop.Data/OrderRepository.csLegacyShop.Data/ShopContext.cs |
| low | Application state | 6 | Global mutable state. Fix: Singleton service or cache. | LegacyShop.Web/Global.asax.cs |
| low | Bundling (System.Web.Optimization) | 8 | Runtime bundling and minification. Fix: Static files + a build-time bundler, or plain tags. | LegacyShop.Web/Web.configLegacyShop.Web/Global.asax.csLegacyShop.Web/Views/Web.configLegacyShop.Web/App_Start/BundleConfig.cs |
| low | Web.config transforms | 5 | Per-environment config via XDT. Fix: appsettings.{Environment}.json + environment variables. | LegacyShop.Web/Web.Release.config |
| low | MVC child actions | 3 | Child actions. Fix: View components. | LegacyShop.Web/Controllers/ReportsController.csLegacyShop.Web/Views/Reports/Index.cshtml |
| low | OutputCache attribute | 1 | MVC 5 output caching. Fix: Output caching middleware. | LegacyShop.Web/Controllers/ReportsController.cs |
| low | Newtonsoft.Json formatter | 2 | Web API 2 JSON settings (and XML negotiation). Fix: System.Text.Json options (or AddNewtonsoftJson). | LegacyShop.Web/App_Start/WebApiConfig.cs |
| low | EF6 database initializer | 2 | Initializers + Seed. Fix: EF Core migrations + seeding. | LegacyShop.Data/ShopInitializer.csLegacyShop.Web/Global.asax.cs |
| low | Old-style .csproj | 4 | Non-SDK project format. Fix: Convert to SDK-style (legacy-package-migrator / upgrade tooling). | LegacyShop.Core/LegacyShop.Core.csprojLegacyShop.Data/LegacyShop.Data.csprojLegacyShop.Inventory/LegacyShop.Inventory.csprojLegacyShop.Web/LegacyShop.Web.csproj |
| low | packages.config | 3 | Old NuGet management. Fix: PackageReference + Central Package Management (legacy-package-migrator). | LegacyShop.Data/LegacyShop.Data.csprojLegacyShop.Inventory/LegacyShop.Inventory.csprojLegacyShop.Web/LegacyShop.Web.csproj |
| Project | Kind | Framework | LOC | Format | Packages |
|---|---|---|---|---|---|
| LegacyShop.Core | library | v4.8 | 128 | old-style | - |
| LegacyShop.Data | library | v4.8 | 304 | old-style, packages.config | EntityFramework 6.4.4 bridge |
| LegacyShop.Inventory | wcf | v4.8 | 89 | old-style, packages.config | EntityFramework 6.4.4 bridge |
| LegacyShop.Web | web | v4.8 | 877 | old-style, packages.config | Antlr 3.5.0.2 removeEntityFramework 6.4.4 bridgeMicrosoft.AspNet.Mvc 5.2.9 replaceMicrosoft.AspNet.Razor 3.2.9 replaceMicrosoft.AspNet.Web.Optimization 1.1.3 removeMicrosoft.AspNet.WebApi 5.2.9 replaceMicrosoft.AspNet.WebApi.Client 5.2.9 replaceMicrosoft.AspNet.WebApi.Core 5.2.9 replaceMicrosoft.AspNet.WebApi.WebHost 5.2.9 replaceMicrosoft.AspNet.WebPages 3.2.9 replaceMicrosoft.Web.Infrastructure 2.0.0 removeNewtonsoft.Json 12.0.3 okWebGrease 1.6.0 remove |
| Impact | Risk | Mitigation |
|---|---|---|
| high | Pricing and cart quirks change silently (order total ignores coupon/VAT, ViewState price, 3-for-2 per line, rounding) | Parity tests on the cart and checkout flow + characterization tests on PriceCalculator before any change. Decide quirk by quirk: keep or fix on purpose. |
| high | Sign-in breaks while two apps run (Forms auth ticket + machineKey) | Remote authentication through the System.Web adapters until the login page moves; then switch to ASP.NET Core cookie auth in one release. |
| medium | Session cart lost between old and new pages | Remote session (System.Web adapters) while both apps run; move cart pages together; serialize CartLine as JSON. |
| medium | API clients depend on 302 redirects from [Authorize] endpoints | Check API consumers. .NET 10 returns 401 - document it as a breaking change or keep the redirect on purpose. |
| medium | Deleting a product deletes its order history (EF6 cascade) | Decide Restrict vs Cascade in the EF Core model; add a soft delete if history must stay. |
| low | Product images use System.Drawing (Windows-only on .NET 6+) | Stay on Windows hosting at first, or move to ImageSharp/SkiaSharp (check the licenses). |