latest Post

Dynamics CRM Patching - Patching over the cracks

When Microsoft introduced patching in CRM 2016 it solved an old age problem. Finally, we didn't have to export and import whole solutions when moving customisations between environments. In the past, this meant either having to hold off on pushing changes live or pushing solutions with unfinished customisations live. However, the introduction of patching and sub component selection in solutions fixed this old age dilemma.

However, there does appear to be a bug in Microsoft Dynamics CRM 2016 V8.0 when trying to apply solution upgrades.

The error reported in the log file is shown in the below Gist but the important bit is " must have the same base solution id". A couple of other users in the community have noticed a similar issue and this blog post suggest Microsoft are aware of the issue and a fix will be shipped in version 8.2.2.  I have since logged my own support case with Microsoft to get a definitive answer. 

However, the issue appears to be related to new functionality released which allows you to delete managed components from a managed solution. In the past we had to accomplish this using the unsupported holding solution technique to remove managed components without data loss. 

Studying the stack trace carefully shows the error is failing to delete something due to a dependency elsewhere.  As we are using CRM online I cannot get access to the SQL database to integrate further what the offending item is.

Where the issue becomes critical for us is that in our development environment our patches were cloned back into the base solution and further work carried out. The problem now is when we try to push the full solution to our live environment we get the following error message "Cannot update patched solution directly, use the holding pattern to upgrade" this is because we need to first apply the solution upgrade. This has left us in a state where we cannot push anything live until Microsoft provide a fix. 

Not accepting no for answer I thought about it logically the “apply solution upgrade” is just a supported way of doing what we used to do back in the day to delete managed components from a solution.  The tried and tested “Holding Solution” method. (see below steps) 

1.       Export base solution as managed from development environment 
2.       Edit the solution name in the customisations.xml file  appending _Holding to the solutionManifest uniqueName.
3.       Rezip and import into live environment
4.       Remove the original managed solution from the live environment (the solution above ensures nothing is deleted)
5.       Export the base solution as managed again and reimport in to the live environment with correct name.
6.       Delete the holding managed solution from the live environment.

Anyway, I tried to do this today following the above steps and it worked without data loss. The only difference is once the holding solution was in place I also had to remove the patches first prior to removing the original managed solution.

Yippee!! we are now back to being able to release changes live. Until Microsoft release a fix we either need to stop using patches or use patches and not clone the patches back into the base solution in our development environment.  

Anyway hopefully this saves someone some time.





Recommended Posts × +

2 comments:

  1. Nice post.Thanks for sharing this post .I really appreciate the kind of topics you post here.
    school erp companies in chennai

    ReplyDelete
  2. This concept is a good way to enhance the knowledge.thanks for sharing. please keep it up Salesforce Online Training Hyderabad

    ReplyDelete