while running the analyzer on our c# projects they aren’t analyzing the files correctly and getting below warning
Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see SonarScanner for .NET | SonarQube Docs
we are using jenkins to run sonarscanner below is the command
d:
cd %WORKSPACE%
sonar-scanner.bat -D"sonar.organization=orgname" -D"sonar.projectKey=projectname" -D"sonar.sources=." -D"sonar.host.url=https://sonarcloud.io" -D"sonar.login=tokenid"
SonarScanner.MSBuild.exe begin /k:"projectname" /d:sonar.login="tokenid"
MSBuild.exe .\Source\applicationname.sln /t:Rebuild
SonarScanner.MSBuild.exe end /d:sonar.login="tokenid"
we tried with two different version of sonnarscanner but still no luck
sonar-scanner-msbuild-5.3.1.36242-net46
sonar-scanner-msbuild-5.3.1.36242-net5.0
Thanks @duncanp for quick reply, above error got fixed after making those changes but now i am getting below error, do you have any idea about this ?
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
21:47:54.153 SonarQube analysis could not be completed because the analysis configuration file could not be found: D:\Jenkins\workspace\ProjetName_CITest\.sonarqube\conf\SonarQubeAnalysisConfig.xml.
21:47:54.154 Post-processing failed. Exit code: 1