我需要分析各种C#文件(不是一个项目,只是放在同一个目录下的.cs文件)。
我尝试了两种不同的分析方法,每种方法都有错误。有人能帮忙解决这些错误吗?
我试过像上面提到的这里那样进行分析
通过在根文件中执行C:\sonar-扫描器\bin\sonar-scanner.bat,我有以下错误
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: Custom and 3rd party Roslyn analyzers
are only by MSBuild 14. Either use MSBuild 14, or disable the custom/3rd
party Roslyn analyzers in your quality profile.2-我厌倦了创建一个项目并使用SonarQube MSBuild扫描仪进行分析
但在最后,我出现了一个错误
The SonarQube MSBuild integration failed: SonarQube was unable to collect
the required information about your projects.
Possible causes:
1. The project has not been built - the project must be built in between
the begin and end steps
2. An unsupported version of MSBuild has been used to build the project.
Currently MSBuild 14.0 upwards are supported
3. The begin, build or end steps have not all been launched from the
same folder
Generation of the sonar-properties file failed. Unable to complete
SonarQube analysis.我安装了Visual 2015,2012,2010,2008。如何验证我使用的是正确的MSBUILD verison ( 14 ),因为我检查了C:\Program (x86)\MSBuild,并在那里找到了版本14。
还有别的问题要处理吗?
最后,我需要能够用第一种和第二种方式进行分析。
提前谢谢你!
发布于 2017-07-05 10:35:58
2-我厌倦了创建一个项目,并使用SonarQube扫描仪进行MSBuild分析。
根据文档,我们需要从要分析的项目的根文件夹执行以下命令:
SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"Project Name" /v:"1.0"
MSBuild.exe /t:Rebuild
SonarQube.Scanner.MSBuild.exe end但是命令MSBuild.exe是一个外部命令,在任意目录下都无法被识别,您应该将MSBuild路径"C:\Program (x86)\MSBuild\14.0\Bin“添加到系统环境中,使开始、生成或结束步骤都从同一个文件夹中启动。
https://stackoverflow.com/questions/44908532
复制相似问题