Rewrite .NET Framework codebases to modern TypeScript with parity
Here’s how to rewrite .NET Framework to TypeScript with zero hand‑waving: we extract specs, generate tests, implement in parallel, and roll out with parity. First, we extract executable specifications from your .NET Framework app—routes, models, WCF contracts, validation rules, SQL/EF behaviors, security headers, and edge-case examples—into OpenAPI and JSON Schema. Next, we generate conformance tests that assert functional, type, and serialization parity between the legacy app and a new TypeScript service. Then, we implement the TypeScript target (usually NestJS or Fastify, with Prisma/Knex/TypeORM) behind those tests, service-by-service, using the LEAP Protocol’s test gates so no endpoint ships without measurable equivalence. Finally, we roll out safely: shadow traffic, diffing responses; then canary; then incremental cutover with fallbacks. This spec-first, test-gated, agent-agnostic approach lets multiple engineers (and AI agents) work in parallel while the tests keep everyone honest. You end with a maintainable TypeScript codebase that preserves behavior, covers sharp edges (dates, decimals, auth), and is productionized for containers, CI, and observability—without stalling feature delivery.
Why TypeScript for .NET Framework migrations
- Strong typing end-to-end. Generate TypeScript types from OpenAPI/JSON Schema so DTOs, validators (class-validator/zod), and clients stay in sync, unlike legacy .NET Framework projects where C# and JavaScript drift.
- Modern async I/O. Node’s event loop (Fastify/NestJS) handles high concurrency efficiently versus thread-per-request patterns common in older ASP.NET/IIS apps.
- Massive ecosystem and velocity. npm packages, SWC/esbuild, and mature server frameworks (NestJS, Fastify) accelerate delivery while keeping linting, testing (Jest/Vitest), and CI first-class.
- Container-native and cross-platform. Linux-first images, small deploys, and consistent local/prod parity versus Windows Server/IIS constraints in legacy stacks.
- Shared language across backend and frontend. Reuse validators, DTOs, and utilities between the service layer and React/Next.js or other TypeScript frontends.
Our methodology
-
Spec extraction from .NET Framework - Parse ASP.NET MVC/Web API controllers, attribute routes, filters, DataAnnotations, and Web.config/IIS behaviors (URL rewrite, limits, compression). - For WCF, lift DataContracts/ServiceContracts and message formats; for EF/Dapper, derive SQL shapes and transactional semantics. - Emit OpenAPI, JSON Schema, and golden examples from production logs (with PII-safe sampling). Capture tricky invariants: number/date formatting, culture, nullability, and error envelopes.
-
Test generation and harnesses - Create conformance suites that hit both systems and assert status codes, headers, payload structure, field-level equivalence, and tolerance windows (e.g., ordering, whitespace). - Generate property- and example-based tests for validators, mappers, and serialization. Stand up cross-runtime parity checks for crypto, hashing, and auth cookies.
-
Parallel TypeScript implementation - Scaffold a NestJS or Fastify service with typed DTOs, middleware, Passport.js strategies, and observability (pino, OpenTelemetry). - Map data access to Prisma, Knex, or TypeORM; for SQL Server, use mssql/tedious with parameterized queries. Preserve transaction boundaries and isolation levels. - Port filters/middleware: CORS, caching headers, model binding, and error handling so test gates pass before any traffic is cut over.
-
Parity-gated rollout - Shadow live traffic to the TypeScript service and diff responses against the .NET system; promote to canary behind feature flags once parity thresholds pass. - Preserve auth/session continuity (cookie names, SameSite/Secure flags, machineKey-compat crypto when needed) and verify end-to-end flows. - Cut over incrementally with automatic rollback, then retire legacy routes.
-
Stabilize and handoff - Harden CI, codemods, and lint rules; document specs as living artifacts. Transfer ownership with dashboards, SLOs, and clear extension guidelines.
Specific .NET Framework concerns we handle
- WCF and SOAP compatibility: Translate DataContracts/FaultContracts to REST/JSON in NestJS, or maintain a SOAP shim if partners require it. Ensure XML/JSON shape fidelity and namespace rules where needed.
- ASP.NET auth to Node: Migrate Forms Authentication/ASP.NET Membership to JWT/cookies via Passport.js; replicate PBKDF2/BCrypt hashes and machineKey-based ticket decryption so sessions survive cutover.
- DateTime, decimal, and culture: Replace JS floating-point with decimal.js/big.js for money; enforce ISO 8601 UTC or original culture semantics; replicate DateTimeKind and round-trip formatting edge cases.
- Entity Framework/LINQ semantics: Recreate query behavior, eager/lazy loading, and transactions with Prisma/Knex/TypeORM; validate SQL against SQL Server (mssql) or target DB; keep parameterization and retry policies.
- IIS/Web.config features: Port URL Rewrite rules, max request size, static file caching, and compression to Fastify/Nginx; map HttpContext/ThreadStatic usage to request-scoped providers and AsyncLocal equivalents.
Proof
- sqlite-leap — one spec, five SQLite engines generated: https://github.com/safitudo/sqlite-leap
- semver-leap — 5,632 passing tests for standards-accurate behavior: https://github.com/safitudo/semver-leap
- LEAP Protocol (spec-first, test-gated, agent-agnostic): https://github.com/safitudo/leap
These public artifacts show how we make behavior executable, then let humans and AI agents implement safely behind tests.
Pricing & timeline
- Typical duration: 4–12 weeks depending on surface area (routes, data access, WCF endpoints, and integrations).
- Commercial model: fixed-price proposal with scope spelled out in the spec and acceptance tests.
- Typical range: $40k–$120k. We price per module/service with parity criteria and rollout plan, not vague “T&M.”
Ready to move from .NET Framework to maintainable, typed, and container-native TypeScript without breaking prod? Share your repo and a staging URL. We’ll extract the spec in days, return a fixed proposal, and start shipping behind tests the following week.
Footer: Leap Agentic — AI-native software delivery using the LEAP Protocol. Brand note: Leap Agentic is distinct from Legacyleap.ai and Impetus Leap AI.
Leap Agentic is distinct from Legacyleap.ai and Impetus Leap AI.