Dotnet --no-incremental question

I’ve a question about the incremental builds with dotnet.
I perform on my GitLab this step that works as expected:

dotnet-sonarscanner begin /k:\"$PROJECT_NAME\" 
dotnet build *.sln --no-incremental --configuration RELEASE"
dotnet-sonarscanner end /d:sonar.token=\"$SONAR_TOKEN\"

I use the option --no-incremental so i do a full analysis forcing to rebuild all projects.
But, why on official docs this option is not mentioned and required?

I ask you because the --no-incremental option increase my pipeline time of 2.5X and I’m understanding if I can remove it.

Hey @DanieleSky ,

You raise a good point, especially since for .NET Framework we explicitly suggest the /t:Rebuild option.
In general, you should specify the --no-incremental flag, so that you know for a fact that everything was built between the begin and end steps.

I will inform the appropriate team to update the documentation and properly reflect this, thanks for pointing it out.

Out of curiosity, how does it make the pipeline slower? I would assume that since it’s a pipeline, it’s a “clean slate” everytime, which would imply that --no-incremental or not, everything is built from scratch.


Hi Gregory,
thanks for your reply.

You are right, my bad: I was comparing the time of a pipeline’s build with the time of a build from my pc.
But the pipeline starts always from a empty folder so the build is never incremental.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.