SonarCloud extension 1.10.0 did not help. The behavior is still exactly the same as I describe in this post.
The problem is not in the task itself, but in the sonar scanner DLLs it contains. I tried my own DLLs and it works.
In our pipeline, we use MSBuild scanner mode:
- task: SonarCloudPrepare@1
And this is not working - it is not able to connect to the https://sonarcloud.io because of the proxy.
I cloned MSBuild scanner and built the latest version (commit 10eeb6638833bf74d61869841ac706c79eb10f26). I did not do anything special, just opened
SonarScanner.MSBuild.sln in Visual Studio 2019 and built it in release configuration - that’s all.
At the build agent, the SonarCloudPrepare task is located in
_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.10.0 folder. And the MSBuild (classic) scanner is located in
classic-sonar-scanner-msbuild subfolder. So in this folder, I replaced the files with mine, built in previous step. I used
netcoreapp3.0 release build.
Furthermore, I had to copy there two more files, which was not in original task, but was in my build output folder, and the task did not work without them.
At last, I had to restart the agent service, because it had some of the DLLs already loaded.
Now the SonarCloud works as expected.
So my conclusion is, that SonarCloud task has some different libraries and
exe file. Can someone investigate this and maybe create a new version of the task, with the latest build of the scanner for
Thank you, Stano
Just note: CLI mode is not working even if I replace all the DLL-s. But CLI mode does not raise errors anyway, it just does not scan
.cs files (just
.html files in our project).