Convert XML to MPP or MPP to XML Programmatically using C#

Extensible Markup Language (XML) is a file format that stores information using tags. It may be used for storing or transferring data. There might be situations where you need to transfer the data stored in an MPP file to some application that accepts XML as an input format. On the other hand, you might have project data in XML format that you may want to convert to MPP format. For such cases, you can inter-convert MPP and XML formats according to your needs. To that end, this article will teach you how to convert MPP files to XML format and vice versa programmatically using C#.

C# API for Converting XML to MPP and Vice Versa

Aspose.Tasks for .NET is an API for working with Microsoft Project (MPP) files. It allows you to read and write MPP/XML files without requiring Microsoft Project to be installed. You can also convert XML files to MPP format and vice versa using the API. You can either install the API through NuGet or download it directly from the Downloads section.

PM> Install-Package Aspose.Tasks

Copy Data from an XML File to an MPP File using C#

The following are the steps to copy data from an XML file to an MPP file using C#.

The following sample code shows how to copy data from an XML file to an MPP file using C#.

Convert an MPP File to an XML File using C#

The following are the steps to convert an MPP file to an XML file using C#.

The following sample code shows how to convert an MPP file to an XML file using C#.

Get a Free License

In order to try the API without evaluation limitations, you can request a free temporary license.

Conclusion

In this article, you have learned how to convert XML files to MPP format and MPP files to XML format using C#. You learned how to achieve these conversions with just a few lines of code using the Aspose.Tasks for .NET API. The API provides many additional features for working with MPP files that you can explore in detail by visiting the official documentation. In case of any questions, please feel free to reach us at our free support forum.

See Also