Create a Work Breakdown Structure WBS using C#

This short guide describes how to create a work breakdown structure WBS using C#. It shares details on setting up the IDE, a list of steps, and sample code for adding and accessing the WBS using C#. You will also get further information to customize the resultant WBS code while working with the tasks in a project.

Steps for Building a Work Breakdown Structure using C#

  1. Set the environment to use Aspose.Tasks for .NET to create WBS in a project
  2. Apply the product license to get the MPP file format as an output
  3. Set up a custom WBS code by setting the properties such as auto-generation, uniqueness checking and a defined prefix string
  4. Add a numbering mask as a 2-digit ordered number separated by dashes for each WBS level
  5. Create a task with two sub-tasks
  6. Create another task with a single sub-task
  7. Recalculate the resultant project to create an updated WBS with each task according to the above configuration
  8. Save the output project and load it again to read each task’s WBS code

The given steps describe the process to work with MS Project WBS structure using C#. Apply the license to create output in MPP format, create and set up a custom WBS code, add a numbering mask, add this definition to the project and add a few tasks in the sample project file. Add a few sub-tasks also under the new tasks, recalculate the project to update the WBS codes with the tasks and save the output.

Code for Building a WBS using C#

This code demonstrates how to set up a work breakdown structure using C#. If you do not want to recalculate the entire project, use RenumberWBSCode() to regenerate the WBS codes, use WBSSequence to vary codes across different levels, and use the Task.WBS or Task.WBSLevel to manually override the auto-generated code.

This article teaches how to work with the project breakdown structure. To convert an MPP file to Excel, refer to the article Convert MPP to Excel using C#.

 English