/// <summary> /// On the initial call to BuildProjectInternal the number of projects in progress in incremented /// to indicate a new project build request is in progress. /// </summary> private void BuildProjectInternalInitial(BuildRequest buildRequest, Project project) { bool startRootProjectBuild = this.numberOfProjectsInProgress == 0 && !Router.ChildMode; /* The number of projects in progress is incremented prior to starting the root project build so if there is an error the number of projects inprogress is decrement from 1 rather than 0. Decrementing from 0 projects in progress causes an exception. */ IncrementProjectsInProgress(); if (ProfileBuild) { buildRequest.StartTime = DateTime.Now.Ticks; buildRequest.ProcessingStartTime = buildRequest.StartTime; } if (startRootProjectBuild) { StartRootProjectBuild(buildRequest, project); } project.BuildInternal(buildRequest); }