Porting a .NET Framework API to .NET 8 while mobile apps keep working

A mobile app in the App Store or Google Play talks to its backend in one exact format. Many users never update, so versions released years ago keep sending requests. When the backend has to leave .NET Framework and Windows, the contract those apps depend on cannot move: the same URLs, the same status codes, the same JSON down to the byte.

We did this for MemoWord, a vocabulary app on iOS and Android that we have supported since 2019. The backend had about 61,000 lines of C# and 40 controllers on .NET Framework. Analysis started on 9 June 2026, and production switched to .NET 8 on Linux on 25 June, 16 days later. The API stayed byte-compatible, so the apps already in the stores and the billing kept working without an app update. The rollout went through staging first.

This article covers where ASP.NET Core changes your responses without telling you, what Linux changes underneath, and how to prove the bytes match before you switch.

What “same API” means for a mobile backend

For a web front end you control, a small change in the response is a deploy away from a fix. For a mobile app, a fix means a new build, a store review and weeks of users on old versions. So you need a stricter definition of “compatible” than “the integration tests pass”.

Write the contract down per endpoint:

  • path, query parameters and HTTP method;
  • status code for success and for each error the app handles;
  • response headers the client reads;
  • body bytes: property names and their case, property order, number and date formats, how nulls are written, how non-ASCII text is escaped.

If a client parses strictly, hashes a payload or compares a response to a stored copy, any of these can break it. Billing endpoints deserve the most care: if the app cannot confirm a purchase with your server, a paying user loses access.

Where ASP.NET Core changes your responses

ASP.NET Web API 2 and ASP.NET Core look alike in controller code. Their defaults differ in ways that show up on the wire.

JSON serializer and property names. Web API 2 used Newtonsoft.Json and kept property names as you declared them in C#, usually PascalCase. ASP.NET Core uses System.Text.Json and writes camelCase names by default. An app that reads UserId gets nothing from userId. The lowest-risk fix is to keep Newtonsoft.Json and copy the old settings:

builder.Services
    .AddControllers()
    .AddNewtonsoftJson(o =>
    {
        o.SerializerSettings.ContractResolver = new DefaultContractResolver();
        // copy DateFormatString, DateTimeZoneHandling, NullValueHandling
        // and any converters from the old WebApiConfig
    });

Non-ASCII text. The default System.Text.Json encoder escapes non-ASCII characters as \uXXXX. Newtonsoft.Json writes them as UTF-8. Both are valid JSON, and both parse to the same string, but the bytes differ. For any app that returns text in several languages, this touches a large share of responses. Keeping Newtonsoft.Json avoids it.

Validation errors. With the [ApiController] attribute, ASP.NET Core returns an automatic 400 response in the ProblemDetails format when model validation fails. Your old API returned its own shape. Either leave [ApiController] off or set SuppressModelStateInvalidFilter = true and return the old body yourself.

Unhandled exceptions. Web API 2 returned a JSON body such as {"Message":"An error has occurred."} for a server error. ASP.NET Core does not write that body on its own, and an unhandled exception typically ends as a 500 without it. If any app version shows that message or branches on it, add exception middleware that writes the old body.

Null results. Return null from a Web API 2 action and the client got 200 with the body null. ASP.NET Core returns 204 No Content for the same code, because of HttpNoContentOutputFormatter. Remove that formatter if old clients expect a body.

Model binding. Web API 2 read complex parameters from the request body by default. ASP.NET Core controllers without [ApiController] bind complex types from form fields, route and query string. Add [FromBody] where the old API read JSON.

Routing. Web API 2 often used a convention route like api/{controller}/{id} and picked the action by HTTP verb from the method name (GetWords, PostWord). ASP.NET Core does not select by method name prefix. Put explicit [HttpGet], [HttpPost] and route templates on each action, then dump the route table and compare it with the old one.

What Linux changes underneath

Moving off Windows brings its own set of differences, separate from the framework.

  • File paths are case-sensitive. Content/Audio/Word.mp3 and content/audio/word.mp3 are two files. Check every path built from strings.
  • Time zone IDs. Windows uses IDs like FLE Standard Time, Linux uses IANA IDs like Europe/Tallinn. Since .NET 6, TimeZoneInfo converts between them when ICU is available, but stored IDs and hard-coded strings still need a check.
  • Globalization. .NET on Linux uses ICU. Culture-sensitive string comparison and sorting can give different results from the old Windows behaviour. Use ordinal comparison where you meant ordinal. Some slim container images run in invariant globalization mode, which changes number and date formatting for cultures other than invariant.
  • System.Web is gone. HttpContext.Current, Global.asax, web.config app settings, Windows authentication, registry access and COM components all need replacements. List them in the first days. They decide the schedule more than the controller count does.

How to prove the bytes match

Reading code catches the defaults above. It does not catch the custom converter someone added in 2016. You need a comparison that runs on real requests.

  1. Inventory every endpoint. Forty controllers is a finite list. Put each action in a table with its route, method and the app screens that call it.
  2. Collect real request and response pairs. Record them from production with personal data masked, or build golden files per endpoint from a database copy.
  3. Run old and new side by side against the same database snapshot. Replay each request to both and diff status code, the headers clients read, and the raw body bytes. Normalize only fields that differ for a legitimate reason, such as server timestamps.
  4. Test with real app builds. Point test builds of the store versions at staging and walk through sign-in, sync and purchase flows.
  5. Switch production with a way back. Keep the old server ready until the new one has carried real traffic through a full usage cycle, including renewals if the app sells subscriptions.

For MemoWord the sequence was analysis, port, staging, production. The store apps needed no changes.

Where AI agents fit in a port like this

We did the MemoWord port with AI agents. An engineer reviewed each change the agents prepared before it reached users. The agents had no access to production secrets and keys, billing and payments, users’ personal data or direct deploys to production. That split suits a migration: a large volume of similar, checkable changes across controllers, with a human deciding what ships. We describe the method on our AI-assisted maintenance page.

The port was part of a wider change in how we work on MemoWord. Comparing the 135 days before and after we started working with agents, commits grew from 39 to 249 in the iOS app and from 2 to 230 in the Android app. Since July 2026 the team has shipped 64 iOS builds across 20 versions and 62 Android builds across 20 versions, with spaced repetition, AI translation, an onboarding A/B test and a subscription trial. The details are in the MemoWord case study.

If you start the port today

In June 2026, when MemoWord moved, .NET 8 was the current long-term support release. Microsoft ended support for .NET 8 on 10 November 2026, and .NET 10 has been the long-term support release since November 2025, supported until November 2028. If you are planning a port now, target .NET 10. Everything in this article applies the same way, since the differences that break mobile clients sit between .NET Framework and modern .NET, and a later step from 8 to 10 is small next to the first one.

Checklist

  • Write the API contract per endpoint: route, method, status codes, headers, body format.
  • Find which app versions are still in use and which endpoints they call.
  • Keep Newtonsoft.Json with a DefaultContractResolver and the old serializer settings.
  • Decide on [ApiController]: leave it off or suppress the automatic 400.
  • Add middleware that returns the old error body for unhandled exceptions.
  • Remove HttpNoContentOutputFormatter if clients expect null with 200.
  • Add [FromBody] and explicit verb attributes, then compare route tables.
  • List every use of System.Web, Windows authentication, registry and COM.
  • Check file paths for case, time zone IDs and culture-sensitive comparisons.
  • Replay real requests against old and new, diff raw bytes.
  • Run store builds against staging through sign-in, sync and purchases.
  • Keep the old server ready for a switch back.

FAQ

Can I keep Newtonsoft.Json in .NET 8?

Yes. The Microsoft.AspNetCore.Mvc.NewtonsoftJson package plugs it into ASP.NET Core with AddNewtonsoftJson(). For a port that must keep responses identical, it is the safest default. You can move to System.Text.Json later, endpoint by endpoint, once old app versions drop out of use.

Do the mobile apps need an update after the backend moves?

Not if the API stays byte-compatible. In the MemoWord port, the iOS and Android apps already in the stores kept working without changes, billing included. If a response changes even in escaping or property case, assume some installed version will break.

How long does a .NET Framework to .NET 8 port take?

It depends less on line count than on how much code touches System.Web, WCF, Windows-only libraries and the database access layer. For reference, MemoWord had about 61,000 lines of C# and 40 controllers, and the port took 16 days from analysis to production. A short analysis of your codebase gives a real estimate.

Should I move to .NET 8 or .NET 10?

Go to .NET 10 if you are starting now. .NET 8 has been out of support since 10 November 2026. The compatibility work described here is the same for both.

If your API serves apps you cannot force to update and you want a second opinion on the port plan, see our web development services or send us a short description of the backend.

What would you like to do next?

Discuss a project

Tell us about the task. Within one working day we reply with questions or a first view on scope and cost.

Start a project

Ask a question

A short question about your app, website or idea. An engineer replies by email.

Get new articles

New articles and case studies by email, no more than once a month. Unsubscribe at any time.

Tell us about your project

Describe the task in a few lines. Within one working day we reply with questions or a first view on scope and cost.

Prefer email or a call?

welcome@revolsource.com
+38 097 662 23 20

Revol Software OÜ, Tallinn, Estonia. Our team is distributed around the world.

Join our team

Send your CV to career@revolsource.com