I am having a similar issue to the one reported here:
It looks like the scan works but no issues are detected. I have a small console app with 2 issues identified by SonarLint but the scanner for sonarscanner.msbuild.exe does not find them.
The summary file in .sonarqube/out has this in it:
Analysis succeeded for SonarQube project “”, version Analysis results
Hwever, I do get these in the output stream:
WARNING WARN: "Property Missing: ‘sonar.cs.analyzer.projectOutPaths’. No protobuf files will be loaded for this project
and
WARNING: WARN: No roslyn issues report not found for this project.
I’ve split this into its own topic and edited your first post to reference the topic you originally posted in.
Are you running SonarLint in connected mode? I ask because if you are not it’s possible your analysis is running with a different set of rules than is being used in SonarLint. If not, then fuller analysis logs will be helpful.
Interesting that you should ask that question. I am only seeing the issues underlined in the code when I am not connected to the sonarqube server. The server was recently set up and right now I am connecting to it as the admin user. Could that be a problem?
When you are not in connected mode, SonarLint applies the Sonar way profile. When you are in connected mode, SonarLint applies the same profile that would/will be applied during analysis.
So it sounds like you want to take a look at what profile is being used and what rules it contains. This may help.
I had to delete the project bindings folder to get it to disconnect again. As soon as I bind to the project instance in the server, the issues disappear in visual studio.
I still think this is about what rules are active in the quality profile, but it may be a question of versions. SonarLint embeds its language analyzers and IIRC uses those versions only in connected mode. So you’ve probably got different versions on the server versus in SonarLint and either the profile is different or the implementation has gotten smarter.
it talks about this error. I am using the scanner for MS Build. However, when I unzip the that file, it includes the sonar-scanner-3.2.0.1227 with it - so I am assuming the MSBuild exe calls it - and gets the same error. Not sure how to proceed.
I am seeing the same issue from the original thread (Matt Stark) when I do the SonarScanner.MSBuild.exe end command.
This is the sequence:
SonarScanner.MSBuild.exe begin /k:CSharpConsoleApp – this seems to work
MSBuild,exe /t:Rebuild – build is successful
SonarScanner.MSBuild.exe end — lots of stuff streams by and in the middle of the stream is the message about the missing property “sonar.sc.analyzer.projectOutPaths’ no protobuf files will be loaded for this project” and then “no Roslyn issues report found for this project”.
But then is says the analysis was successful - but no issues are found. The issue about the SonarLint not finding any issues in connected mode may or may not be related to this scanner issue - no idea.
thanks,
Paul
PS - when I look in the project that was created in the server, it doesn’t know it’s a C# program…
SomeConsoleApplicationTest.csproj : unit test for said app.
I have read that the scanner is supposed to ignore projects with the word test in it - but I wasn’t aware that it would skip everything. generally, we keep our tests in a separate solution but this is just a simple solution I pulled down to see if I can get Sonarqube working. Perhaps I should try one of our real projects. One issue I have is one of our legacy projects doesn’t work with MSbuild.
tried it on another solution that doesn’t have “test” in it and I get the same error about the missing sonar.cs.analyzer.projectoutpaths property. It does create a .sonarqube.out directory with all kinds of stuff in there - just not all the right stuff I guess.
OK, my issue is resolved. It turned out the way my path environment variable was setup, it was executing an old version of MSBuild from .NET Framework. Once I updated it to run MSBuild v14 from Visual Studio, the scans started working. Thanks!