SonarLint analysis yields no results when solution has multiple projects

Hi @danich93 , and thanks for sharing your problem.

Usually, when no issues are reported, this means we were unable to load your solution.

For big solutions, if the loading takes too long, there is a timeout. If this timeout is reached, then no issues will be reported during analysis. The solution is loaded by SonarLint when the first analysis is triggered (that’s why logs of a later analysis are not very useful). The fact it works only when you keep a single project is strange. Maybe some specific configuration in your solution that we don’t support?

Could you please collect the verbose logs when SonarLint attempts to start OmniSharp and load your solution? This should happen after starting Rider, the first time an analysis is triggered (when opening a file for example).
The interesting logs I’m looking for should start with:

Starting OmniSharp...
/usr/lib/dotnet/dotnet6-6.0.110/dotnet /home/julien.henry/.local/share/JetBrains/Toolbox/apps/Rider/ch-0/222.4167.23.plugins/sonarlint-intellij/omnisharp/net6/OmniSharp.dll -v --hostPID 148648 MsBuild:MSBuildOverride:MSBuildPath=/usr/lib/dotnet/dotnet6-6.0.110/sdk/6.0.110 MsBuild:loadProjectsOnDemand=false DotNet:enablePackageRestore=false --encoding utf-8 -s /home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6.sln --plugin /home/julien.henry/.cache/JetBrains/Rider2022.2/tmp/sonarlint/.sonarlinttmp_18233295559358680275/slServices/SonarLint.OmniSharp.DotNet.Services.dll
Process 150411 started

up to

Omnisharp: [INFORMATION] Omnisharp server running using Stdio at location '/home/julien.henry/RiderProjects/ConsoleApp1Net6' on host 148648.
{"Event":"started","Body":null,"Seq":26,"Type":"event"}
OmniSharp successfully started

and then

Omnisharp: [INFORMATION] Loading project: /home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/ConsoleApp1Net6.csproj
Omnisharp: [INFORMATION] Successfully loaded project file '/home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/ConsoleApp1Net6.csproj'.

up to

{"Event":"ProjectConfiguration","Body":{"ProjectId":"22a8bd18-068d-4cf8-90fd-028744cab953","SessionId":"1868838127","OutputKind":0,"ProjectCapabilities":["GenerateDocumentationFile","CSharp","Managed","ReferencesFolder","LanguageService","RelativePathDerivedDefaultNamespace","AssemblyReferences","COMReferences","ProjectReferences","SharedProjectReferences","OutputGroups","AllTargetOutputGroups","VisualStudioWellKnownOutputGroups","SingleFileGenerators","DeclaredSourceItems","UserSourceItems","CrossPlatformExecutable","SupportsHotReload","Pack"],"TargetFrameworks":["net6.0"],"SdkVersion":"-755749860","References":["f9b57385e04dcef1","b04d1a92c03aa393","740a41f35e38e687","a650b002a55ee732","8bb25cdfa9f58d95","ca01f9c6c9519128","a7db6d4c13eb109a","4787ec450370cdc","faae3cd2329a5f23","b136c9057d0eac41","a4be57a67913d9f2","c2f7e51423366080","9221249557edf7da","ac08b9147e6c6cc1","fc8f31a851b2f1e","3d1fab7a1546aa70","75c42701c310d265","6eac5906d797823f","51b6b65db45d8317","977562ede61122d1","6f06be6c7dad3d57","782a823a2d8cd40","13bbf2cbcdb96469","a8b1d9f359d7b4f","8db448e27f0bad1b","5faa84ffcc646d16","3dd9e1e713ce28c1","bc70a3688f03b546","3e025539204a5d59","12bec27505c61c10","65e9cc7358ddee2e","7df5bfe00323a6a8","ce3f444652eead51","feebdde9a00fe94b","22d24df113118e04","6a8ada60e30e6abf","6001a9b860f7e43","e94e5ff7b2eb39a9","46b5412910b12f1a","eac4975c939bd705","a777367473e5f95c","d574426ce261f3cd","2620772be337bacb","ce4b86769789bfd2","afe098e2b8eb2364","4bca77302b767821","b42e3bf9c2caf9d","11d6a5981dd09f1d","2528657f041a0f71","1a4910e7928d2be4","385f6cb9a1a92341","8a6a053fd546c4b9","4bd5d70d9487a7","546da94a433dd46b","c8cd67501180cdb3","99380cc3f9cb0f62","2b71ac54faa4d900","6d26f5b6d581bb7a","e99748daf45287f7","88a79e3fbc9be5a5","baed534980001b3e","a094f278ebd28638","f02b6f1120327ed5","1fdb3be137e7c8ab","d8d06e6254ff9a8","7a37191fa2429c0","db2085d40be0c6b","732e2f41e1ec328f","cc0b8a0dc4b5cc17","b3ec78066692ce40","b633596fb5206911","b1c086ddba588d7f","3935c25fc587591d","1fe2caf02ff5116","d1e401c8e175f133","d795c4b069f42de2","28889d355be716fb","987004758afb653e","a93a13f245d3dbf5","c2c7e5dd6bcf2f46","f40e391e11837c28","1f1effdb4f95fef","4b3556ed143bb1a1","990c07b3a694f061","16f3b3c6aa66dbea","bbc2c7fb9307d0f8","cae96c695fa0a849","23af2e185bf7f884","10682f5180926917","531413e8ae8921e9","cbb2e2956b8bc5a1","693159958e045249","abb76040f918f212","2978ebe3fa017619","d753dc831058d377","5d5ab2fae13c7cd7","6f36e9e201c8abbc","2c2215284100c1bc","abef39459b5f8089","58b2ccb5d5268768","f4c238ed95a4c9e0","463559064b820a89","f46a5248555641f3","d9a0d90fcf36b125","f707ec8ff0716b6a","d31ae060adc0cf68","b740561cbe999190","6f6cd086b29443f","3e2b84419c2678fe","16aa5cd16608904e","88efed4970ce8fb","525af1cb4f8c1ef","82365a1d92723ea2","f9081118726c671d","1dc6ba4b51a92fe2","480fcc9a46d59829","96ae799a9cd65a64","53da3fcaf9d4a664","762862983c40286f","7143cd55e6267a10","9c4f1e8060c475b4","5641b1bfbef8f076","c074fd9cba688aec","6b8a7cd56172fed1","5d25704a6a0be6ed","7de0d61ed8a595ec","85c2a8db5105888","ec2dac2bf194d54a","baae63d2bc6dd501","6e18d5f5513ced07","ecc917c3c9b5c475","3e60a289d38463fa","3297b865f846bd0a","34cfcce7d574a410","762c57508db7a1c2","81016cf6be9235ed","96f5a81e8df6f19c","bc2ea691e56496f8","5d957776a3bc8463","4fcdd50549f35f69","1613d6b76156e26a","609f5396c0534146","31be6951d8a1de6e","d373f3c4566c70c6","b42e1bda5a17dc0e","3017ef0c38e2d837","92e480fdaacc79e0","ffb314483a45fa40","3159cfd5553fa1b8","6a5eaa177b0b8d54","add48a46678bd09d","c70f2a1b237f229d","3beb376886d63c97","363b07840a344182","f638dfb632c7bb3e","4fc1e02f10ba6dcc","7f7e058ceeba44c4","76fdeb10eb04a251","c229c6a3986d545b"],"FileExtensions":["-1257278712"],"FileCounts":[4]},"Seq":351,"Type":"event"}
{"Event":"ProjectAdded","Body":{"MsBuildProject":{"ProjectGuid":"00000000-0000-0000-0000-000000000000","Path":"/home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/ConsoleApp1Net6.csproj","AssemblyName":"ConsoleApp1Net6","TargetPath":"/home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/bin/Debug/net6.0/ConsoleApp1Net6.dll","TargetFramework":".NETCoreApp,Version=v6.0","SourceFiles":["/home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/Program.cs","/home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/obj/Debug/net6.0/ConsoleApp1Net6.GlobalUsings.g.cs","/home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs","/home/julien.henry/RiderProjects/ConsoleApp1Net6/ConsoleApp1Net6/obj/Debug/net6.0/ConsoleApp1Net6.AssemblyInfo.cs"],"TargetFrameworks":[{"Name":".NETCoreApp","FriendlyName":".NETCoreApp","ShortName":"net6.0"}],"OutputPath":"bin\\Debug/net6.0/","IntermediateOutputPath":"obj\\Debug/net6.0/","Configuration":"Debug","Platform":"AnyCPU","IsExe":true,"IsUnityProject":false}},"Seq":352,"Type":"event"}
Projects successfully loaded

If you are concerned that those logs may contain private information, feel free to share them with me privately.

Also, would you be able to share a minimal reproducer? For example, keeping only 2 projects that don’t contain sensitive code, but still demonstrate the issue.

Finally, if you prefer to investigate on your end, you can have a look at our wiki page, where there are some advanced configurations you can try to experiment with, to see if this allows loading your solution.

You can for example try one of:

  • increase sonar.cs.internal.startupTimeout (not useful if you can see the OmniSharp successfully started log)
  • increase sonar.cs.internal.loadProjectsTimeout or set sonar.cs.internal.loadProjectsOnDemand to true if you can see in logs that projects are still loading, but timeout is reached

and please report any improvement.