Azure Dev Ops / c# / Slow build times

Template for a good new topic, formatted with Markdown:

  • ALM used : Azure DevOps
  • CI system used : Azure DevOps
  • Languages of the repository: C#
  • Error observed: Extremely slow build times

We are trialing Sonar Cloud, and our build times have gone from 10 minutes, so not finishing after 2 hours.
I have tried disabling warning that appeared the most (Using clause which was unusued), but this doesn’t seem to have an impact.

All the threads on here about it reference bugs that look to be fixed.

I don’t really know where to start debugging or getting support. Is this expected behaviour? ITs about 150 cs projects, none of them very big.

Hi Tank104,

Welcome to the community support!

Could you clarify a little bit?
Are you saying that you build 150 projects C# and it went from 10 minutes to more than 120 minutes?

Does this mean you run SonarCloud analysis on each project?

If t’s the case and we consider the following:

  • the SonarCloud scanner scans every project = 150 analysis to perform
  • each analysis takes 1 minute to scan the code which is quite fast (but can be improved if the scope is reduced to the minimum) = 150 minutes of code analysis. Even with a 30 seconds step, the build time will be multiplied by 8.

At this scale, 150 projects, every new step which does something signififcant (and the scanner does look for a lot of things) will obviouly make the whole process longer.

Could you provide a couple of background task ids?

Thanks for using our product.


Hi Olivier,
A background task example is AXU0Gk3BKGBZPjxNtwmS

In our situation (where we have a big monolith), and the time is as expected - how often would you run analysis then? We wanted to run it on every Pull Request, so that we could see any warnings in the PR review stage - which I understand we can do. But with it adding 3 hours on, its just not feasible everytime.
We could run it once a week to review I guess…

Are there certain checks we can turn off to get the time taken right down?

Hi @tank104

Overhead is expected on the build step, no matter how many projects you have. But in your case, it’s certainly too much.

Would it be possible to share the build log (i’ll send you a PM) so that we can review it with our analyzers expert ?

Thanks in advance.

2 posts were split to a new topic: SonarCloud increases duration from 15-20 minutes to 80-100 minutes on a .NET build

Sorry I have been on holiday, still on list - hopefully by end of week.
Also to confirm I did send build log to your colleague. We were just going to test the one project that is really slow, and see if I can send through to you.

@mickaelcaro - More and more people encountering the same issue , I reported this issue like 2 months ago and no resolution till date

Hi @tank104 - please let us know if there’s any help you need in the investigation and if you want to continue the discussion in a private thread, to share logs and code more freely.

Ok I have a project which exposes the issue which I could share privately (but you would need to delete it after finding the issue).

Whom should I share it?

An update: @tank104 sent us a reproducer via a private thread and we identified the problem and added a comment to an existing issue we’ve had in the same area. We now have more information to tackle the problem, for which we are grateful.

2 posts were split to a new topic: C# slow build times on SonarCloud