I need to delete all objects in a solution (ideally in a batch). I have already found several ways to get all their IDs by retrieving the solutioncomponent table. But it seems that to delete them I also need their LogicalName or Name, depending on their type, and then I have to use different delete methods for each type.
I got it to work with a lot of code, loops and case distinctions. Is there a more elegant or simpler way?
I'll post my own code later as an answer, but it's long and I don't like it very much, and it's hard to decide which way to go.
Is RetrieveMetadataChanges an option? It seems complicated and I haven't tried it yet.
Deleting a solution component programmatically is very error prone because of the underlying dependencies
So unless there is a pressing need, creating a solution to programmatically delete does not yield good results