Handling Priorities
Contents
[
Hide
Show
]Understanding Task Priorities
In Microsoft Project, priorities are used to guide automatic resource leveling — the process of resolving conflicts when a resource is over-allocated.
- Priority values range from 0 to 1000:
0= lowest priority (task is most flexible during leveling).1000= highest priority (task is least flexible and usually left unchanged).
- By default, tasks are assigned a priority of 500.
This mechanism helps Microsoft Project decide which tasks can be delayed or split during scheduling adjustments.
Working with Priorities in Aspose.Tasks
Aspose.Tasks for .NET provides access to task priorities through the Tsk class:
- Priority
Type: Integer (
0–1000) Purpose: Gets or sets a task’s priority level.
Checking Task Priority in Microsoft Project
To check or modify a task’s priority in Microsoft Project:
- Double-click the task in the Task Entry form.
- Go to the General tab.
- Adjust the Priority field.

Example: Reading Task Priority with Aspose.Tasks
The following example shows how to retrieve a task’s priority and output it to the console:
1Project project = new Project("New Project.mpp");
2
3// Create a ChildTasksCollector instance
4ChildTasksCollector collector = new ChildTasksCollector();
5
6// Collect all the tasks from RootTask using TaskUtils
7TaskUtils.Apply(project.RootTask, collector, 0);
8
9// Display Priorities for all tasks
10foreach (Task task in collector.Tasks)
11{
12 Console.WriteLine(task.Get(Tsk.Name) + " - Priority : " + task.Get(Tsk.Priority).ToString());
13}Key Notes
- Priorities affect resource leveling only — they do not directly change task scheduling until leveling is applied.
- Lower priority tasks are more likely to be delayed or split during conflict resolution.
- Setting critical tasks to high priority ensures they remain on track even if resources are constrained.
FAQ
Q: What happens if two tasks have the same priority?
- Microsoft Project applies other factors (dependencies, dates, constraints) to decide which task is adjusted first.
Q: Can priorities be changed programmatically in Aspose.Tasks?
- Yes. You can set the
Tsk.Priorityfield to any integer value between 0 and 1000.
Q: Is the default priority always 500?
- Yes. Unless explicitly changed, tasks created in Microsoft Project or Aspose.Tasks are assigned priority 500.