Solution Layers and Conflict Resolution
Complete the full lesson to earn 25 points
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks and see fewer ads — read each lesson on a single page with Pro
Mastering Solution Layers and Conflict Resolution in the Power Platform
Introduction: Why Solution Layers Matter
When you start building applications in the Microsoft Power Platform, you often begin in a single environment, working on a single solution. As your projects grow in complexity, you inevitably transition to a multi-developer, multi-environment model. This is where the concept of Application Lifecycle Management (ALM) becomes critical. At the heart of healthy ALM in the Power Platform lies the concept of "Solution Layers."
Understanding solution layers is not just a technical requirement; it is the difference between a stable, predictable production environment and a chaotic landscape where changes randomly disappear or break existing functionality. When multiple solutions or patches affect the same component, the Power Platform uses a specific hierarchy to determine which version of that component actually runs at runtime. If you do not understand how these layers interact, you will encounter the "it worked in dev, but it's broken in production" scenario, which is usually caused by an unexpected layer overriding your intended configuration.
This lesson will guide you through the mechanics of solution layering, how to identify conflicts, and the practical strategies required to manage these layers effectively. By the end of this module, you will be able to manage complex deployments with confidence, ensuring that your changes are applied exactly as you intend.
Understanding the Foundation: What are Solution Layers?
In the Power Platform, a solution is essentially a container for your components—apps, flows, tables, and security roles. When you import a solution into an environment, you are effectively adding a "layer" to the components contained within that solution. If you later import another solution that modifies one of those same components, you are adding a new layer on top of the existing one.
The system uses a "last-in-wins" strategy for layers, but with a specific hierarchy. The lowest layer is the "Base" layer (the system default), and each managed solution you import adds a new layer on top. When a user interacts with an app or a flow, the platform evaluates these layers from top to bottom. The first layer that defines a specific property for that component is the one that takes effect.
The Hierarchy of Layers
To visualize this, imagine a stack of transparent sheets. Each sheet contains instructions for a component. If the top sheet says "Button Color: Blue," the system uses blue. If the top sheet is blank for that specific property, it looks at the next sheet down. If the second sheet says "Button Color: Red," the system uses red. If neither sheet defines the color, it falls back to the default system configuration.
- System Layer: The foundational configuration provided by the platform.
- Managed Solutions: These are the layers added by your imported solution files. Each managed solution creates a new, distinct layer.
- Active/Unmanaged Layer: This is the "top" layer. Any changes made directly in the environment (outside of a managed solution) reside here.
Callout: Managed vs. Unmanaged Explained Managed solutions are intended for production environments. They are locked, meaning you cannot edit them directly. Unmanaged solutions are intended for development environments. They are fully editable. When you move a solution from Dev to Test or Prod, you export it as a "Managed" solution. Any change made directly in a production environment creates an "unmanaged" layer on top of your managed solution, which effectively overrides everything underneath it. This is the most common cause of deployment failures.
Practical Examples of Layering Conflicts
Let us look at a common scenario involving a Dataverse table. Suppose you have a table called "Project Task."
- Version 1.0 (Managed): You deploy a solution that adds a field named "Priority" to the "Project Task" table.
- Version 2.0 (Managed): You create a new solution that changes the "Priority" field to be "Required." You deploy this to the same environment.
The system now has two layers for the "Priority" field. The version 2.0 layer sits on top. Because version 2.0 explicitly defines the "Required" property, the system respects that. However, what happens if you go into the production environment and manually change the field to "Optional"? You have now created an "Active" (unmanaged) layer. Because the Active layer is the highest in the hierarchy, the "Required" setting from your version 2.0 solution is ignored, and the field remains "Optional."
Identifying Layers
You can view these layers directly in the Power Apps maker portal. This is a vital diagnostic skill.
- Navigate to the solution containing the component.
- Select the component (e.g., a Canvas App or a Dataverse Table).
- In the command bar, click the three dots (More Commands).
- Select "See solution layers."
This screen will show you the stack of layers, starting with the most recent (top) and ending with the base layer. If you see a layer labeled "Active," it means someone has made a manual change in that environment that is overriding your managed solution.
Resolving Conflicts: The "Remove Active Customizations" Strategy
When you discover an unwanted unmanaged layer, you have a few ways to resolve it. The most common approach is to remove the active customization.
Step-by-Step: Clearing Unmanaged Layers
- Navigate to the "See solution layers" view as described above.
- Identify the layer labeled "Active."
- Select the layer.
- Click "Remove active customizations" in the command bar.
Once this is done, the system will delete that top layer, and the component will immediately revert to the configuration provided by the next layer down (your managed solution).
Warning: The Data Loss Risk Before you remove active customizations, always check what that layer contains. If a colleague made a necessary hotfix directly in production and you delete that layer, that hotfix will disappear immediately. Always document manual changes and ensure they are captured in your source control before clearing layers.
Advanced Conflict Management: The Merge Logic
It is important to understand that not all components behave the same way when layered. Some components are "merged," while others are "overwritten."
- Overwritten Components: If you change the display name of a field, the new value completely replaces the old value. It is a binary state—the top layer wins entirely.
- Merged Components: Some components, like Site Maps or Ribbon/Command Bar definitions, use a merge logic. If you add a new button in a second solution, the system tries to combine your new button with the existing buttons from the first solution.
This is where things get tricky. If you customize a command bar in your base solution, and then import a second solution that also customizes that same command bar, the system attempts to reconcile these changes. If the changes conflict (e.g., you both try to change the icon of the same button), the top layer will win.
Best Practices for Avoiding Conflicts
To minimize the headache of managing layers, follow these industry-standard practices:
- Keep Solutions Small: Avoid "monolithic" solutions that contain every component in your environment. Smaller, modular solutions are easier to track and have fewer overlapping components.
- One Developer per Component: If possible, ensure that only one developer is working on a specific component at any given time. If two developers change the same flow in different solutions, you are guaranteed to have a layer conflict.
- Source Control is Truth: Your source control (GitHub or Azure DevOps) should be the only place where "final" configurations exist. If a change is needed in production, make it in the source code, build a new solution version, and deploy it. Do not use the production environment as a design surface.
- Use Environment Variables: Avoid hardcoding values like URLs or IDs inside your components. Use Environment Variables. If you need to change a value, you update the variable, not the component itself. This prevents the need to create new layers for simple configuration changes.
- Strict "Managed" Policy: In production environments, disable the ability for users to create unmanaged layers if possible, or enforce a strict policy where any unmanaged layer is considered a "bug" that must be resolved by moving the change into the solution.
Deep Dive: Managing Flows and Canvas Apps
Canvas Apps and Cloud Flows are notorious for layering issues because they are complex objects. When you modify a flow, you are often changing the trigger, the actions, and the connections.
Example: The Flow Update Conflict
Imagine you have a flow that updates a status field. You deploy this in Solution A. Later, you realize you need to add an email notification. You create Solution B and add the same flow to it. You modify the flow to include the email action.
When you import Solution B, the flow is updated. However, the connection references might change. If Solution B uses a different connection than Solution A, the flow might fail. Always ensure that your connection references are consistent across solutions. Use "Connection References" instead of hardcoded connections to ensure the flow can adapt to the environment's specific credentials without creating a new layer that breaks the logic.
Callout: Connection References vs. Connections A "Connection" is the actual credential (e.g., your login to Office 365). A "Connection Reference" is a pointer to a connection. By using references, you decouple the logic of the flow from the specific authentication token. When you deploy to a new environment, you simply map the reference to a valid connection in that environment, avoiding the need to edit the flow itself.
Comparison: Handling Conflicts Across Environments
The following table summarizes how to handle common conflicts based on the type of environment you are working in.
| Scenario | Dev Environment | Prod Environment |
|---|---|---|
| Component Change | Edit directly in the solution. | Update in Dev, redeploy as a new version. |
| Unmanaged Layer Found | Ignore (it's the nature of Dev). | Investigate, document, and remove. |
| Conflict Detected | Merge/Overwrite in the designer. | Use "See solution layers" to identify the culprit. |
| Deployment Strategy | Import/Export as Unmanaged. | Import as Managed. |
Common Pitfalls and How to Avoid Them
1. The "Ghost" Change
This occurs when a developer makes a change in a production environment, forgets about it, and then wonders why their latest solution deployment didn't update the app.
- The Fix: Always check the "Solution Layers" view before assuming the deployment failed. The deployment likely succeeded, but your manual change is sitting on top of it.
2. Over-Layering
If you have five different managed solutions touching the same table, you have created a "spaghetti" architecture. It becomes impossible to track which solution is responsible for a specific field property.
- The Fix: Refactor your solutions. Group components by feature or business domain so that solutions do not overlap unnecessarily.
3. Ignoring Dependencies
If you remove a component from a solution, but it is still being used by another component in a different layer, you can break the entire system.
- The Fix: Always use the "Show Dependencies" feature before deleting components. Ensure that your solution dependencies are well-documented in your ALM documentation.
Step-by-Step: The Ideal Deployment Workflow
To ensure you never run into layer conflicts, adopt this workflow for every release:
- Development: All work happens in an unmanaged solution in a Dev environment.
- Commit: Once a feature is complete, commit the changes to your source control system (e.g., using the Power Platform Build Tools).
- Build: The build pipeline creates a managed solution file.
- Test/Validation: Deploy the managed solution to a Test/UAT environment.
- Audit: Use the "See solution layers" tool to ensure no unexpected "Active" layers exist.
- Production: Deploy the same managed solution file used in Test to the Production environment.
- Post-Deployment: If an issue is found in Production, do not fix it in Production. Create a "Hotfix" branch in your source control, make the change in Dev, and go through the deployment pipeline again.
Technical Deep Dive: The XML Structure of Layers
While you don't need to edit the XML directly, understanding it helps you understand why layers occur. A managed solution is essentially a compressed file containing customizations.xml. When you look at the layers, the system is essentially comparing these XML files.
When you see a property in an "Active" layer, it is because that specific attribute (e.g., isrequired="0") is explicitly defined in the active layer's XML. If the attribute is missing, the system proceeds to the next file in the sequence.
<!-- Example of a simplified property definition in a solution layer -->
<attribute>
<logicalname>new_priority</logicalname>
<isrequired>1</isrequired> <!-- This is the property that defines the behavior -->
<displayname>Priority</displayname>
</attribute>
If you have a layer above this that says <isrequired>0</isrequired>, that value takes precedence. If you remove that top layer, the system falls back to the 1 defined here. This explains why deleting an active layer can cause a "reversion" to previous behavior—it is simply falling back to the next available definition in the stack.
Frequently Asked Questions (FAQ)
Q: Can I merge two managed solutions into one? A: Not directly. You would need to create a new solution, add the components from both, and then deploy that new solution. You would then need to remove the old solutions if they are no longer needed.
Q: Does deleting a solution remove the data in the tables? A: No. Deleting a solution removes the component definitions (the table structure, views, forms), but the data (the records) remains in the Dataverse database. However, be careful—if you delete a table component, you may lose access to the data through the UI until you recreate the table.
Q: What is the "Base" layer? A: The Base layer consists of the core system components installed by Microsoft when the environment was created. You cannot remove the base layer.
Q: How do I know which solution is the "top" layer? A: The "See solution layers" screen lists the layers in order. The one at the top is the one currently in effect.
Best Practices for Enterprise Teams
In an enterprise setting, you should have a "Solution Architect" role responsible for the solution map. This person ensures that:
- Solutions are divided by functional area (e.g., "Finance Module," "HR Module").
- Common components (like shared libraries or themes) are kept in a "Core" solution that other solutions depend on.
- Version numbers follow a strict semantic versioning (e.g., 1.0.0.1) to track progress.
By keeping the solution architecture clean, you reduce the surface area for conflicts. If every team is working in their own solution and only interacting with the "Core" solution, the risk of accidental layer overrides drops significantly.
Summary and Key Takeaways
Managing solution layers is a fundamental skill for any Power Platform developer. By mastering the hierarchy and the tools to inspect it, you move from being a "builder" to a "solution architect."
Here are the key takeaways to remember:
- Hierarchy is Everything: The system always evaluates layers from top to bottom. The first layer that explicitly defines a property wins.
- Active Layers are Dangerous: Always check for "Active" layers in production. They are almost always the result of manual, unmanaged changes that override your deployment.
- Use the Tooling: The "See solution layers" feature in the Power Apps portal is your best friend. Use it early and often when diagnosing deployment issues.
- Source Control is the Single Source of Truth: Never treat the production environment as a place to make changes. All changes must originate in your source control and be deployed via managed solutions.
- Small, Modular Solutions: Break your applications into smaller, manageable chunks. This makes it easier to track dependencies and prevents complex layering conflicts.
- Connection References are Essential: Use them to decouple your flows and apps from specific environment credentials, preventing "layer bloat" caused by changing connections.
- Document and Communicate: In a team environment, clear communication about which solutions are being updated is as important as the code itself.
By following these principles, you ensure that your Power Platform applications remain stable, maintainable, and predictable, regardless of how large or complex your organization becomes. ALM is not a burden; it is the framework that allows your team to scale without breaking the systems your users rely on every day.
Continue the course
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles your daily points limit so you progress twice as fast, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× daily points limit
- ✓ Distraction-free lessons