Fix TargetInvocationException from xml profile serialization issues (2279035)