Upgrading a .NET MAUI application is rarely hard because of one breaking change.
It’s hard because upgrades sit at the intersection of framework evolution, platform requirements, tooling, and existing architecture — and those things rarely move in sync.
A “simple” MAUI upgrade can involve:
- A new .NET SDK
- Updated MAUI workloads
- Android and iOS minimum version changes
- Package deprecations
- Build pipeline assumptions that no longer hold
- Platform issues that only appear once the app actually launches
Most teams know this — yet upgrades are still handled as ad‑hoc tasks, driven by release pressure or looming support deadlines. That’s usually where things start to go wrong.
I wanted to change that.
Instead of treating MAUI upgrades as a one‑off activity, I treated them as a design problem — and the result was a reusable upgrade prompt whose job is to enforce good engineering behaviour by default.
This post explains why that prompt exists, how it’s structured, and why the prompt itself is the real product.
⭐ The Prompt Is the Solution
This approach isn’t about AI magically upgrading your app for you.
The prompt is the star of the show.
- 🧠 It encodes experience
- 🛑 It enforces discipline
- 🧭 It removes ambiguity
- 📋 It turns upgrades into a guided, auditable workflow
Without a strong prompt, assistants tend to optimise for “making things compile”.
With a strong prompt, they optimise for doing the upgrade properly.
The assistant becomes an execution partner — but the prompt defines the rules of engagement.
🚨 What the Prompt Is Designed to Prevent
The prompt exists because the same failure patterns show up again and again in MAUI upgrades:
- ❌ Accidentally upgrading to preview or RC SDKs
- ❌ Architecture drift during “harmless” refactors
- ❌ Dependency churn justified as “best practice”
- ❌ Full solution builds run blindly and repeatedly
- ❌ Android or iOS issues discovered at the very end
- ❌ CI pipelines failing after the upgrade is merged
These aren’t edge cases — they’re the default outcome of unstructured upgrades.
Every section of the prompt exists to counter one of these failure modes.
🧩 A Practical MAUI Upgrade Prompt Pattern
Below is a practical example of the upgrade prompt pattern I use.
It focuses on structure, sequencing, and guardrails — the things that actually make upgrades predictable and repeatable — rather than on any single application or codebase.
💡 Think of this as a blueprint, not a script.
The value is in how the pieces fit together.
// MAUI Upgrade Prompt Pattern
// Purpose: enforce a structured, low-risk MAUI upgrade process
You are an experienced .NET MAUI engineer performing a framework upgrade.
Target the latest fully released, stable MAUI version unless otherwise specified.
Do NOT use preview, RC, or beta SDKs, workloads, or NuGet packages.
Primary objectives:
- Maintain application stability throughout the upgrade
- Preserve architectural intent and existing design decisions
- Minimise unnecessary or speculative changes
- Ensure Android and iOS builds succeed and launch
Architectural constraints:
- Preserve existing navigation patterns
- Maintain strict MVVM boundaries
- Keep views lightweight and UI-focused
- Avoid conditional compilation in shared source code
- Place platform-specific code behind proper abstractions
Before making any changes:
- Inventory current MAUI and .NET versions
- List all projects and target frameworks (TFMs)
- Identify key packages and build tooling
- Review CI/CD pipelines for SDK or MAUI assumptions
- Confirm required SDKs and workloads are installed
Upgrade workflow:
1. Plan the upgrade and document required changes
2. Update project files and target frameworks
3. Align dependencies using stable releases only
4. Address breaking changes deliberately and incrementally
5. Build and test incrementally, avoiding unnecessary rebuilds
6. Validate Android and iOS builds and app launch
7. Review and justify any optional or non-essential changes
Operational rules:
- Warn before running long or expensive build commands
- Pause after each major step for review or confirmation
- Produce a final summary of changes, outcomes, and risks
Definition of done:
- Solution builds successfully
- Android app launches successfully
- iOS app launches successfully
- Architectural intent remains intact
This prompt is intentionally opinionated — because upgrades are not the place for ambiguity.
🧠 Why Each Section Exists
🎯 1. Role and Quality Bar
The prompt starts by defining how the assistant must behave.
- ✅ Stability‑first mindset
- ✅ No experimentation during upgrades
- ✅ Engineering judgement over novelty
Without this, tools tend to suggest newer APIs, introduce architectural changes “for improvement”, or optimise for cleverness rather than safety.
Upgrades demand restraint — the prompt enforces it.
🏗️ 2. Architectural Guardrails
Upgrades are where architecture erodes quietly.
The prompt explicitly protects against that:
- No surprise navigation changes
- No UI logic leakage
- No platform hacks in shared code
The result is that the application still feels like the same system after the upgrade — just on a newer framework.
⏱️ 3. Build‑Time Awareness
MAUI builds are expensive, slow, and easy to overuse.
The prompt treats build time as a cost to manage, not an afterthought:
- ⚠️ Warn before long builds
- ⚡ Prefer incremental validation
- 🧹 Avoid unnecessary cleans
This keeps humans in control and prevents blind iteration.
🗺️ 4. Context Before Action
Most upgrade pain comes from missing context.
The prompt forces an inventory before touching code:
- Framework versions
- Project structure
- Dependencies
- CI/CD assumptions
Nothing changes until the landscape is understood.
This alone eliminates a huge class of late‑stage surprises.
🚦 5. Gated, Sequential Execution
The upgrade is broken into explicit phases, each with pause points.
- ✅ Failures are isolated
- ✅ Reviews are meaningful
- ✅ Rollback remains viable
This mirrors how experienced engineers already work — but makes it explicit and repeatable.
📱 6. Platform Validation Is Non‑Optional
The prompt does not consider the upgrade complete unless:
- ✅ Android builds and launches
- ✅ iOS builds and launches
- “It builds” is not a definition of done.
Mobile apps fail on devices, not in IDEs — and the prompt enforces that reality.
🔍 7. Review of “Optional” Changes
One subtle but powerful rule:
- The prompt explicitly asks for a review of changes that might not be required.
Why this matters:
- Prevents silent scope creep
- Documents trade‑offs
- Keeps upgrades honest
This is where discipline usually slips — and where it’s restored.
✅ Why This Works
This approach doesn’t automate expertise — it captures it.
The prompt:
- Makes assumptions explicit
- Encodes hard‑won experience
- Reduces cognitive load
- Scales across teams and projects
Most importantly, it turns MAUI upgrades from a stressful event into a repeatable engineering process.
🧠 Final Thoughts
If your MAUI upgrades feel unpredictable, the problem usually isn’t the framework.
It’s the lack of structure.
A well‑designed prompt won’t remove the need for engineers —
but it will ensure their experience shows up every single time.
And once you’ve used this approach for upgrades, you’ll start seeing other places where a good prompt can act as guardrails — migrations, refactors, and CI/CD changes included.
Top comments (0)