Need help with importing an existing project (MS Project . mpp file) and then updating its timeline details (start/end dates, milestones, etc.) programmatically

Hi,

I’m new to using .NET and want to kick things off by importing an existing project (MS Project . mpp file) and then updating its timeline details (start/end dates, milestones, etc.) programmatically.

  1. What’s the best way to load an .mpp file?
  2. How do I access and update project tasks, especially milestone dates and dependencies?
  3. Any best practices or caveats I should watch out for when modifying and saving changes back to .mpp?

Sample code snippets or links to relevant documentation would be much appreciated.

Thank you!

If you need to load and update .mpp files in .NET you have three main options: use Microsoft.Office.Interop.MSProject , which requires MS Project installed locally but gives full read/write control; use Aspose.Tasks for .NET , a commercial library that works without MS Project and is the most reliable choice for server or cloud automation; or use MPXJ , a free open-source library that can read .mpp but cannot save back to that format (only XML/MPX). With Interop you can open a project, loop through tasks, update start/finish dates, set milestones, and adjust predecessors, but it’s limited to desktop scenarios; with Aspose you can achieve the same programmatically and also add task links, then save directly back to .mpp . Best practices include always backing up the file before writing, validating dependency strings, and choosing your library based on whether you only need to read data (MPXJ), work on a workstation with Project installed (Interop), or handle robust read/write automation in production (Aspose).

1 Like