Fix TargetInvocationException from xml profile serialization issues (2279035)

Seems like this is repeated logic, other than deleting the old profile.  ANy reason we can't delete the old profile in both cases and do this in one method?