Timeout when trying to open big solutions with many projects

Description

When trying to analyze a file from a big solution having many projects, the analysis will timeout before the solution is fully loaded, and so no issues are reported.

This is a well known performance issue on OmniSharp side.

One quick fix would be to increase the timeout, or make it configurable, but I'm concerned by the user experience, waiting multiple minutes until the first analysis results are appearing.

I discovered the loadProjectsOnDemand feature that has been contributed to OmniSharp in 2018.

When using this flag, OmniSharp will not load projects at startup, but only the first time a file of this project is accessed. The problem is that the logic to find the .csproj a file belongs to is not 100% reliable IMO.
Also if a project depends on another project(s) of the solution, there will be possibly missing dependency resolutions, and so less accurate analysis.

Activity

Julien HenryJuly 7, 2022 at 4:31 PM

See https://github.com/SonarSource/sonarlint-omnisharp/commit/a39a9b379e32fec184b0e27fad679e254df96a2e

It is now possible to define the analysis property sonar.cs.internal.loadProjectsOnDemand=true and this will skip initial loading of the solution. Projects will be loaded one at a time, when analyzing a file they contain. This might lead to less accurate analysis, especially regarding cross file/references analysis.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Sentry

Created October 26, 2021 at 8:21 AM
Updated September 16, 2024 at 1:15 PM
Resolved July 8, 2022 at 2:53 PM