-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
soanrC# plugin #1034
Comments
I can confirm this. |
@rexuekonglong are you using Scanner for MSBuild or just Scanner CLI? The latter is not directly supported and could generate the errors you mentioned. The only way to analyze .NET projects is through the Scanner for MSBuild. @daguiler could you please run the Scanner for MSBuild with /D:sonar.verbose=true and send us the logs, it would be of great help diagnosing the problem. |
@valhristov I user the Sacnner CLI 3.0.3 all the time . When sonarqube is 6.3.1 Scanner CLI work, then I upgrade sonarqube to 6.7.1 and the sonarC# plugin , Scanner CLI can't just analyze .NET code . |
To analyze .NET code you have to use Scanner for MSBuild. The analysis is faster and more precise than older versions with Scanner CLI, however you will not be able to analyze non-.NET languages in the same time. There is no way to use Scanner CLI with SonarC# 6+. |
Attaching the logs @valhristov. I noticed this warning is occurring for all of our test projects, for example from line 3384 to line 3477 (BusinessLogic.UnitTests). Also, and this is probably a different issue, I don't see any analysis information for some of the projects, like from line 3478 to line 4389 (Bss). I'm seeing many compilation warnings for that project in the log (lines 2192 to 2253), but I don't see them listed in SonarQube afterwards. Specifically, following lines caught my eye:
Even though it says it detected 6 .pb files, I don't see any code issues in SonarQube for this project. A similar project, for which I do see code issues, is the project from line 4491 to line 4890 (DataAccess). This one seems to work ok. |
Thanks for the detailed log @daguiler. The test projects' results were silently not uploaded to SonarQube before, you could safely ignore those warnings for now. We will add full support for test project analysis and unit test results in the near future. Regarding the main projects, I see that you are using |
mm I'll give it try, but not sure because using the same script with SonarC# 6.6 correctly yields results from that project |
I am closing this ticket, please let me know if you still have trouble running the analysis. |
@valhristov you were saying "There is no way to use Scanner CLI with SonarC# 6+." -- Until the update to SonarQube 6.7.1, SonarC# 6.7.1 I was also happily running analyses using SonarQube 6.5.0, Scanner 3.0.3 and SonarC# 6.6.0. |
That's the ticket that drops the MSBuild 12 support - #374, it was released with SonarC# 6.0. Without the code in it, it should be impossible to analyze without Scanner for MSBuild (that's a breaking change, hence the major version bump). |
@valhristov I have exactly the same issue:
Running Sonar 6.7.1 (migrated from 5.6.3 to 5.6.7 then to 6.7.1) with plugins:
I am using the sonar scanner for msbuild version 4.0.2.892. Note: This is the first time I have used the sonar scanner for msbuild as previously we used the sonar runner. I have the output in debug mode but corporate policy is stopping me from uploading it to here, is there any other way I can send you the file? |
@TheGrussalo what version of MSBuild are you using? Later versions of Scanner and SonarC# do not support MSBuild 12 and earlier. |
@valhristov I'm running 15.5.180.51428 The commands I'm using are:
The analysis completes but there are no FxCop or StyleCop rules (yet they are visible in vs). |
@TheGrussalo the Could you share the logs with me? I have opened a file request on my Dropbox where you could upload the logs: Also it would be nice if you could run msbuild.exe with the /v:diag switch and upload that log too. The multi-language projects are not supported for the time being, you will have to analyze your files twice (once for C# with Scanner for MSBuild and once for JS with the normal Scanner CLI) to two separate SonarQube projects. We will be working on fixing this inconvenience in the future, but I cannot say when at this moment. |
@valhristov I uploaded some files yesterday, let me know if anything else would help. |
@valhristov : Hi valhristov, we got the same problem with C# project. It did not generate an output-cs folder: "Analyzer working directory does not exist. Analyzer results won't be loaded from this directory". And we're using Sonarqube 7.0 and run SonarQube.Scanner.MSBuild to analyze. Please advise |
@TheGrussalo @toanvo729 Could you open (each one of you) a separate issue for your problem. Usually there are small differences and it gets hard to follow when mixing logs and answers. Thanks |
SonarQube dashboard is not showing any errors or bugs.
Have added 1 python and 1 C# code file in my source folder & ran the Sonar scanner. SonarQube displays the bugs of python file however does not display any errors of c# file. |
@milindkarpe, as I mentioned before in this thread, scanning .NET source code with Scanner CLI is not supported; you need to use the Scanner for MSBuild. The general recommendation for multi-language projects is to scan them separately and have two SonarQube projects - one for .NET and one for the others. However, if you add the Python (or JavaScript, etc.) to your .NET project, they should be automatically picked up by the Scanner for MSBuild. The other language files must be referenced by the .NET project, if they are just present in the same folder it will not work. |
@valhristov Thanks for reply!
Have installed the MSBuild 14 on machine and ran the Sonar-Scanner for MSbuild and its working. |
I had a similar problem that proved to be an MSBuild compatibility issue. Using MSBuild from the Microsoft.NET Framework folder didn't work; using the one from Visual Studio 2017 did. Didn't work: Worked: |
Hi @bbi-yggy, We are aware of this behavior and haven't been able to identify (yet) why this doesn't work with the one inside the framework folder. |
"2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" is the only build tools for VS2017 since .net framework 4.7
At 2018-07-25 05:21:49, "Yossarian King" <notifications@github.com> wrote:
I had a similar problem that proved to be an MSBuild compatibility issue. Using MSBuild from the Microsoft.NET Framework folder didn't work; using the one from Visual Studio 2017 did.
Didn't work:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
Worked:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I've recently upgraded our SonarQube server from a 5.x version to a 7.2 version. I've launched the database migration like it is described in the documentation, and the server seems correctly upgraded.
I have also a lot of error messages like this :
The analyze is launched from VSTS with the SonarQube plugin and with the additional parameters :
With the "verbose" option, I have these informations :
I really don't understand what is the problem. I've tried to find a solution on internet, but without success. |
Any solution to the last comment/question? I'm having the same issue with the same version and haven't found a solution yet. Thanks! |
Please create a new issue and post all required information and logs. Even if your issue looks alike we know from past experience that they are rarely exactly the same. |
Description
Sensor C# Properties [csharp]
Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.
0/0 source files have been analyzed
Repro steps
1.my C# project property (sonarqube 6.3) then I upgrade sonarqube to v6.7.1
sonar.projectKey = Preferential_net
sonar.projectName = Preferential_net
sonar.projectVersion = 1.0
sonar.sources = .
sonar.language = cs
what's 'sonar.cs.analyzer.projectOutPaths' mean?
Does it mean the C# project code need to be compiled ?
What the hole sonarC# projcet property is ?
Related information
The text was updated successfully, but these errors were encountered: