Output Change Set as XML

How to export the compare results output as an XML file.


1 June 2016

It's now possible to output the Data Sync change set as an XML document directly from the Compare Results and via Project Automation.

Simply press the “Export Results Xml” button on the Compare Results to generate an Xml Document containing the change details.

Export Results

The Xml Output format is a .NET XML DataSet file that contains multiple tables Added, Changed-Source, Changed-Target and Deleted. (These files can be read by the .NET DataSet Provider in Data Sync)

Xml Output

If you then want to output a change set file automatically each time the sync runs you can use Project Automation End event to output the change file.

Get a Change Set XML Serializer from the Compare Result and write the result to a file.

public override void End(ProjectAutomationResult result)
    {
        if(result.HasChanges)
        {
            result.CompareResult.GetChangeSetSerializer().WriteXml(string.Format("ChangeSet-{0}.xml", Environment.TickCount));    
        }
    }