This content originally appeared on DEV Community and was authored by Fernanda Ek
Hey folks! 👋 I’ve got quite a story to share about a little sweaty moment I had with Power Platform. If you’ve ever had a situation where you needed to convert a managed solution into an unmanaged one, keep reading… I’ve got a trick for you.
How it all started: Importing
So there I was, trying to import a solution back into my Power Platform environment. I got this error:
"The import solution must have a higher version than the existing solution it is upgrading."
Honestly, I wasn’t sure how to fix it 😵💫
The Discovery
Not one to give up easily, I decided to dig into the solution file itself. I unzipped the solution and opened the solution.xml
file. This file contains all the details of your solution. Here’s a peek at the code:
<ImportExportXml version="9.2.24052.196" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SolutionManifest>
<UniqueName>QMS</UniqueName>
<LocalizedNames>
<LocalizedName description="QMS" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<Version>1.0.0.4</Version>
<Managed>0</Managed>
<Publisher>
<UniqueName>xxxxxxxxx</UniqueName>
<LocalizedNames>
<LocalizedName description="xxxxx" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<!-- Other tags omitted for brevity -->
</Publisher>
<RootComponents>
<!-- Components list -->
</RootComponents>
<MissingDependencies />
</SolutionManifest>
</ImportExportXml>
I noticed the <Version>
tag and thought, “What if I just bump up the version number?” So, I changed <Version>1.0.0.4</Version>
to something higher, like <Version>1.0.0.7</Version>
, saved the file, zipped it back up, and tried importing it again. Success! 🎉
The “Eureka” moment with <Managed>
While I was poking around, another tag caught my eye: <Managed>
. It was set to 0
, which means it was an unmanaged solution.
Note: In the context of many programming languages, 0 and 1 are used as Boolean values to represent false and true, respectively.
Curious, I wondered what would happen if it was a managed solution, if it was set to 1
🤔 Then I decided to test it out with a managed solution… I changed it to 0
.
• 1: This means the solution is managed. Managed solutions are typically used in production environments where you don’t want users to modify the solution directly. The 1 here is like saying “Yes, this is managed.”
• 0: This changes the solution to unmanaged. Unmanaged solutions are often used in development environments because they allow for direct modifications. The 0 here is like saying “No, this is not managed.”
So, by changing the tag from 1 to 0, you’re effectively telling Power Platform that the solution should no longer be treated as a managed solution, allowing you to edit and customize it freely.
So, I did just that:
<Managed>0</Managed>
I saved the file again, zipped it up, and imported it back into my environment. And guess what? The solution was now imported as an unmanaged solution! 🎉
Here’s how to do it
-
Unzip and Edit:
- Unzip the exported file and open
solution.xml
. - Change the
<Managed>
tag from1
to0
.
- Unzip the exported file and open
If you’re facing a version issue, update the <Version>
tag to a higher number.
I find it easier opening it directly in Visual Studio Code, you can of course open with notepad as well.
-
Zip and Import:
- Zip up the files and import the solution back into your environment.
Voilà! You now have an unmanaged solution.
When to use this trick
Managed solutions are great for deploying stable versions to production environments but if you ever need to modify something or if you’ve somehow lost your unmanaged version and need to make changes, this little trick can save you tons of time.
Conclusion
While this trick works, it’s more of a workaround than an official method. Use it wisely and always keep backups of your solutions. Also, keep in mind that this might not be suitable for all scenarios, especially in production environments where stability is key.
I hope this helps you out as much as it did for me 🚀
This content originally appeared on DEV Community and was authored by Fernanda Ek
Fernanda Ek | Sciencx (2024-06-25T16:36:41+00:00) Power Platform Hack: Turning a Managed solution into Unmanaged. Retrieved from https://www.scien.cx/2024/06/25/power-platform-hack-turning-a-managed-solution-into-unmanaged/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.