Fix TargetInvocationException from xml profile serialization issues (2279035)

Why we do not have this logic inside profile client migration method?