Welcome on this forum, please read the welcome post for an insight on best-practices and must-share information. Notably:
In this case here I would advise you first review recommendations on how to analyse C# code (and also the Jenkins integration of Scanner for MSBuild). Give it a try, iterate a bit, and if not successful then do share more details about what you’ve tried and what your findings/observations are so far.
Hi there, here are the following versions of the products im using.
SonarQube: 7.3
SonarC#: (build 5690)**
the scanner of jenkins
I was not sure where to get the file generated by the verbose so i uploaded the file generated by jenkins.
Also I notice indeed there is quite a few warnings.
CSC : warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.LiteralsShouldNotBePassedAsLocalizedParameters cannot be created from C:\Users\jferreira\AppData\Local\Temp.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly ‘Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified…
As you may have noticed in the release notes SonarC# 7.0 upwards requires Roslyn 1.3 which means that you need to build using Visual Studio 2015 Update 3 / Build Tools 2015 Update 3.
The warning CS8032 you are quoting actually warns you that you don’t have the required version of Roslyn (i.e. Visual Studio / Build Tools) installed on your machine.
Hello @Ammo
you said:
“I didn’t said you have to update to .Net 4.6 but simply that you have to update the version of MSBuild / Visual Studio you are using.”
In the second command below do we have to give 4.6 as target framework? Our server version is community 7.0 and c# plugin version is 5.8 (build 645.
In addition what is the lowest framework version Sonar supports in c# analysis?
1)SonarScanner.MSBuild.exe begin /k:"project-key"
2)MSBuild.exe /t:Rebuild
3)SonarScanner.MSBuild.exe end
If you are still experiencing some issue, could you please create a new thread explaining the problem you are facing (even if it seems similar to this one) so that we can help you?
Looking at the update center for SQ 7.0 I can see that the version 5.8 of SonarC# is not officially supported so you will have to update it. To answer the second part of your question, we need the .net 4.6 for the scanner for msbuild to run BUT we don’t have any requirement on which version your project is targeting.
Hello all,I have the same problem, C# files not being analyzed, but I think the cause is different from what has been discussed in this post.
I’m using SonarQube 7.5 and using visual studio 2017 to build. For some reason most of the projects in my solution are detected from SonarQube as test projects. I don’t understand why, because the path does not include the Test word.
After the analysis was performed, when watching the file ProjectInfo.log, I can see most of my projects are flaged as test projects when they aren’t.
I upload the ProjectInfo.log file for reference. I cannot see where the analysis log is generated when using the sonar.verbose parameter. Please tell me if needed.