There is a set of rules that should be applied while moving solutions from one instance to another, so there is an idea to use a custom tool that will make all changes, export and import solutions to another instance. The question is next:
How could "solution upgrade applying" be implemented with C#?
Importing "as holding" easily could be done by setting (CRM 2016 SDK)
var import = new ImportSolutionRequest();
import.HoldingSolution = true;
this allows to have a holding solution in a target environment, but after some tests we still can't "Apply" this upgrade for the previously installed solution.
Thank you in advance.
After you have imported the holding solution you can upgrade it using a
DeleteAndPromoteRequest
.A basic example:
In the
DeleteAndPromoteResponse
theSolutionId
property holds theGuid
of the promoted solution.