π§ Introduction
When developing a Power Apps Component Framework (PCF) control, packaging it into a solution is a crucial step before deployment in Dynamics 365 CRM or Power Apps.
Solutions allow developers to bundle components like tables, forms, views, and PCF controls into a single deployable unit.
There are two main solution types:
Unmanaged Solution: Editable; used for development and testing.
Managed Solution: Locked; ideal for production deployment.
Traditionally, developers had to build each version separately using the <Managed> tag or MSBuild parameters β but now, thereβs a simpler, unified way.
βοΈ Step 1: Create the Solution Folder
Start by creating your solution using the Power Platform CLI:
pac solution init --publisher-name CloudVerve --publisher-prefix cv
This creates a folder like:
PCFSolution/ βββ Other/ βββ src/ βββ PCFSolution.cdsproj βββ Solution.xml
Then, link your PCF control to this solution:
pac solution add-reference --path ../MyPCFControl
π§© Step 2: Enable Both Managed & Unmanaged Builds in .cdsproj
Now the magic part β instead of manually toggling <Managed> or running separate builds,
you can generate both solution packages (Managed & Unmanaged) in one single build by adding this property group to your .cdsproj file.
Open your solution project file:
PCFSolution\PCFSolution.cdsproj
Then add the following XML inside it:
<PropertyGroup> <SolutionPackageType>Both</SolutionPackageType> <SolutionPackageEnableLocalization>false</SolutionPackageEnableLocalization> </PropertyGroup>
π§ What this does:
<SolutionPackageType>Both</SolutionPackageType> β Creates both managed and unmanaged ZIPs automatically.
<SolutionPackageEnableLocalization>false</SolutionPackageEnableLocalization> β Skips localization resources unless needed.
π Step 3: Build the Solution
Run the build command:
msbuild /t:rebuild
After build completes, youβll get two separate ZIP files automatically:
bin\Debug\ βββ PCFSolution.zip β Unmanaged Solution βββ PCFSolution_managed.zip β Managed Solution
β No need to edit Solution.xml or run multiple builds β both versions are generated in one go.
π¦ Step 4: Import the Unmanaged Solution in Dynamics 365 CRM
Now that your Unmanaged ZIP is ready:
Choose your Environment
Navigate to Solutions β Import Solution
Upload the PCFSolution.zip file
Click Next β Import
Once imported, your PCF control becomes available in your appβs environment.
π§± Step 5: Set PCF Control on Field or Subgrid
After successful import, you can attach your PCF control to either a Field or Subgrid (Dataset).
πΉ For a Field Control
Used when your PCF interacts with a single field (like a rating, toggle, or progress bar).
Steps:
Go to the Table β Form Editor
Select a field (e.g., Probability %)
Click Change Control
Choose your PCF Control (e.g., CloudVerve.ProgressBarControl)
Configure parameters if any
Save and Publish
πΉ For a Subgrid / Dataset Control
Used for displaying lists of records in custom layouts (like Kanban, calendar, or charts).
Steps:
Open Form Editor β Add a Subgrid
Select your data source (table/view)
Click the Subgrid β Change Control
Select your dataset PCF (e.g., CloudVerve.KanbanControl)
Configure dataset properties
Save and Publish
Your subgrid now shows a fully custom React-based layout instead of a static grid.
π Step 6: Deploy Managed Solution to Production
Once testing is done in your development or sandbox environment:
Use the Managed version (PCFSolution_managed.zip)
Go to Solutions β Import in your Production environment
Upload the Managed ZIP
Click Import
Managed solutions:
Are locked (canβt be edited directly)
Ideal for production
Support version-controlled upgrades
π§ Quick Recap
Step | Action | Command / File | Output |
---|---|---|---|
1 | Create Solution | pac solution init | Solution folder |
2 | Add PCF Control | pac solution add-reference | Links control |
3 | Enable Both Builds | Add <SolutionPackageType>Both</SolutionPackageType> | Dual build config |
4 | Build | msbuild /t:rebuild | Managed + Unmanaged ZIPs |
5 | Import to Dev | Power Apps Portal | Deploy Unmanaged |
6 | Deploy to Prod | Power Apps Portal | Deploy Managed |
π§° Example Output Structure
PCFSolution/ βββ bin/ β βββ Debug/ β βββ PCFSolution.zip (Unmanaged) β βββ PCFSolution_managed.zip (Managed) βββ Other/ βββ src/ βββ PCFSolution.cdsproj βββ Solution.xml
πΌ CloudVerve Technologies β Your Power Platform Experts
At CloudVerve Technologies, we help organizations streamline their Dynamics 365 and Power Platform solutions with:
β Custom PCF Controls (Field + Dataset)
β Solution Packaging Automation
β Managed / Unmanaged Deployments
β Environment Migration Strategy
Our Microsoft-certified experts ensure your deployment pipelines are fast, consistent, and production-ready.
π Visit Us
CloudVerve Technologies
π Contact us today for a free consultation on building, packaging, and deploying your next Power Platform solution.