Udostępnij za pośrednictwem


Different behavior of StopOnFirstFailure flag with respect to slns and xxprojs in Team Build

 

Issue -

StopOnFirstFailure flag is respected when we are building multiple solutions and find the error in 1st solution and stop building the rest of solutions. However when we have a scenario where a solution contains multiple projects (csproj’s) and 1st project has error, the build continues to build the remaining projects and this flag does not have any effect.

Explaination

StopOnFirstFailure flag says -

    … for each of the “things” I passed into the Projects parameter of the <MSBuild> task, please build them all even if one of them fails (StopOnFirstFailure=false), or please stop as soon as any of them fails (StopOnFirstFailure=true). In team build case, the “thing” you’re passing in is a .SLN. So <MSBuild> task will attempt to build the whole .SLN, regardless of your StopOnFirstFailure setting. The behavior of .SLN builds is defined as attempting to build all projects within it, even if one of them fails, and there’s no easy way to change that behavior. 

If you still want to immediately stop the build on getting the build break, then you need to know the list of projects that are contained within the SLN. You need to pass list of projects to the Projects parameter of <MSBuild> task. Since team build does not have this information at disposal, there is no easy way to fix it.

Comments

  • Anonymous
    November 07, 2008
    Hi, I am using TeamBuild 2008 and building only one solution. When there is an error within one of the projects it is stopping the build right there and not giving me a chance to see if there are any other issues with the rest of the projects included with the solution. I tried the StopOnFirstFailure>false</StopOnFirstFailure> with in the <PropertyGroup> with no effect, which now makes sense after reading your post. But my concern is why, the build stops after the first failure. Are there any other locations I should look into, like the proj files or should I provide the setting as a solution parameter? Thanks in advance. Regards Sucharith Vanguri