Working with Task Links

Overview

In project management, task links (also known as task dependencies) define the logical relationship between tasks. They allow project managers to model execution order, identify dependencies, and calculate the project schedule.

Using Aspose.Tasks for .NET, developers can programmatically create, modify, or remove task links in Microsoft Project (MPP/XML) files without the need for Microsoft Project installed. This enables advanced automation scenarios such as schedule analysis, critical path calculation, or dynamic project generation.

Core API Classes

The main classes used when working with task links are:

 1    var project = new Project();
 2
 3    // Create two tasks
 4    Task task1 = project.RootTask.Children.Add("Design Phase");
 5    Task task2 = project.RootTask.Children.Add("Implementation Phase");
 6
 7    // Create a Finish-to-Start link (default type)
 8    TaskLink link = project.TaskLinks.Add(task1, task2);
 9
10    // Optionally change the link type
11    link.LinkType = TaskLinkType.StartToStart;
12
13    // Save the project
14    project.Save("TaskLinksExample.mpp", SaveFileFormat.Mpp);

Practical Scenarios

Conclusion

Task links are the foundation of a project schedule. With Aspose.Tasks for .NET, you can fully manage dependencies programmatically — from creating simple Finish-to-Start links to modeling complex cross-project relationships. This enables developers to build powerful scheduling, analysis, and reporting tools tailored to specific business workflows.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.