This is the expected behavior. Tasks should be small discrete units of work. Only tasks in C that have an explicit or implicit dependency on a task/output in A or B would necessarily run after that task in A/B, and only that specific task, not all tasks in the project. You can add dependencies (dependsOn) task ordering requirements/hints (mustRunAfter/shouldRunAfter), but this almost always a bad practice if there’s not an actual dependency.