Saving Updated Resource Assignment to MPP

Contents
[ Hide Show ]

Aspose.Tasks for .NET supports updating resource assignment data and writing it back to a MPP file.

Updating Resource Assignments

To read, assign and save the updated file:

  1. Read an MPP file. The one used in this example contains one task and one resource without any assignments.
  2. Assign the resource to the task.
  3. Add the assigned resource to the project.
  4. Finally, save the project to the MPP file.

The code examples given below demonstrates how to perform these tasks.

1Project project = new Project("New Project.mpp");
2Task task = project.RootTask.Children.GetById(1);
3Resource resource = project.Resources.GetById(1);
4
5// Create resource assignment
6ResourceAssignment assignment = project.ResourceAssignments.Add(task, resource);
7assignment.Set(Asn.Notes, "Newly added assignment");
8
9project.Save("UpdateResourceAssignment_out.mpp", SaveFileFormat.MPP);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.