From Xamarin to .NET MAUI: Lessons Learned Migrating Enterprise Mobile Apps
Introduction
The evolution from Xamarin.Forms to .NET MAUI represents a major leap forward in cross-platform app development. For enterprises with large, legacy Xamarin apps, this migration is not just about moving code — it’s about future-proofing entire ecosystems.
Over the past couple of years, I migrated multiple enterprise-grade mobile applications — some still running on Portable Class Libraries (PCLs) and using deprecated third-party packages — into modern .NET MAUI apps. Along the way, I encountered technical gaps (like poor documentation on Firebase push notifications), deprecated libraries, and compatibility hurdles.
This article shares the strategies, challenges, and best practices I learned — so your migration journey can be smoother.
Why Migrate from Xamarin to .NET MAUI?
1.) Xamarin End-of-Life: Xamarin support ended in May 2024. Staying on it risks security and compatibility issues.
2.) Unified Project Structure: MAUI consolidates iOS, Android, Windows, and macOS into a single project.
3.) Performance Gains: Faster startup, trimming, and native handlers.
4.) Future-Proofing: .NET MAUI is Microsoft’s investment for cross-platform apps, with deep Azure and Blazor integration.
Challenges Faced During Migration
1. Legacy PCL Projects
Some of our Xamarin projects were still using PCLs (Portable Class Libraries), which are obsolete. Migrating required moving everything to .NET Standard first, and then upgrading to .NET MAUI.
➡️ Lesson: If you’re still on PCL, plan a two-step migration (PCL → .NET Standard → .NET MAUI).
💡 Migration Tip
If your project is still on PCL, follow a two-step migration:
👉 PCL → .NET Standard → .NET MAUIIf you do not want to follow two-step migration project, skip directly to .NET MAUI:
👉 Create a fresh MAUI project and reuse your XAML (do not forget to refactor UI where ever needed), while refactoring Dependency Injection, ViewModels, and shared services for the new architecture.
2. Deprecated Libraries
Several libraries (e.g., plugins for permissions, media, or SQLite) were no longer maintained.
➡️ Solution: Replace with .NET MAUI Essentials or community-supported libraries (e.g., Plugin.Maui.Audio, SQLite-net).
3. Missing Documentation on Firebase Push Notifications
Official docs for Firebase push notifications in MAUI were sparse. Most examples were Xamarin-based and didn’t fully translate.
➡️ Solution:
- Used Firebase Admin SDK with MAUI handlers.
- Wrote custom implementation for both Android and iOS push flows.
- Documented internally to avoid future guesswork.
4. .NET Starter Libraries Using Deprecated APIs
Even official “starter” templates sometimes referenced deprecated libraries.
Get Bharat Kolla’s stories in your inbox
Join Medium for free to get updates from this writer.
➡️ Solution: Strip templates down, rebuild with current .NET 8 libraries, and rely on long-term supported packages.
Step-by-Step Migration Strategy
a.) Audit the Existing Project
- List all dependencies and NuGet packages.
- Identify custom renderers.
b.) Upgrade from PCL to .NET Standard
- Intermediate step before MAUI.
c.) Migrate to .NET MAUI Project Structure
- Single project with platform folders.
d.) Replace Renderers with Handlers
- Custom UI logic refactored to MAUI Handlers.
e.) Re-implement Features
- Push notifications with Firebase.
- Offline storage with SQLite/CoreData.
- Authentication with Azure AD.
d.) Testing & Optimization
- Unit tests with NUnit/xUnit.
- UI automation tests.
- Optimize startup with trimming/AOT.
e.) Deployment
- Integrated CI/CD via Azure DevOps.
- Staged rollout (beta → production).
Real-World Case Study
In one of my projects, we migrated a mission-critical mobile application used by hundreds of consultants across the globe. The app played a key role in enabling consultants to log work activities, access project details, and receive real-time notifications, regardless of location.
🔎 Original State
- Built on Xamarin.Forms with PCL shared code.
- Relied on deprecated third-party plugins for storage, authentication, and push notifications.
- Performance bottlenecks: long startup times, frequent crashes, and inconsistent offline behavior.
- Limited scalability: Adding new features often meant modifying multiple platform projects separately.
⚙️ Migration Strategy
- Step 1: Upgrade Path — Migrated from PCL to .NET Standard before moving to .NET MAUI.
- Step 2: Architecture Overhaul — Introduced a clean MVVM architecture with centralized Dependency Injection.
- Step 3: Push Notifications — Rebuilt Firebase push notifications for both iOS and Android, since Xamarin implementations were outdated and poorly documented.
- Step 4: Security — Upgraded authentication to Azure AD OAuth2 with MFA, ensuring enterprise-grade security.
- Step 5: CI/CD Pipeline — Automated builds and deployments with Azure DevOps, enabling faster rollouts across iOS and Android.
🚀 Results
- Performance Gains: Startup time improved by 35%, and crash rate dropped by 50%.
- Code Maintainability: Reduced from 4 platform-specific projects to 1 unified MAUI project, cutting maintenance overhead.
- Global Adoption: Consultants from multiple regions (US, Europe, Asia) now used the same app with consistent performance.
- Scalability: The refactored architecture allowed new features (like offline sync) to be added with minimal effort.
Best Practices
- Do a dependency audit first — don’t start migration blind.
- Use feature flags (LaunchDarkly/Flagsmith) to enable gradual rollouts.
- Document gaps (especially push notification setups).
- Create a rollback plan in case migration blocks delivery timelines.
- Automate testing early with CI/CD.
Future of .NET MAUI in Enterprises
- Blazor Hybrid: Combine web + mobile apps seamlessly.
- AI Integration: Embedding GPT-powered features directly into mobile workflows.
- Microsoft’s Roadmap: Ongoing support as part of .NET 8/9/10 LTS.
Conclusion
Migrating from Xamarin.Forms to .NET MAUI isn’t a copy-paste exercise — it’s a modernization journey. While challenges like PCL projects, deprecated libraries, poor Firebase documentation, and outdated starter libraries can slow progress, the rewards are worth it: better performance, reduced maintenance, and a future-ready stack.
For enterprises, the key takeaway is this: don’t wait until Xamarin is no longer viable. Plan your migration now, adopt modern libraries, and embrace .NET MAUI’s ecosystem to future-proof your apps.




