问题描述
我将SonarQube 6.1与MSBuild.SonarQube.Runner-2.2.0.24安装在一起,以分析C#解决方案.运行分析时,出现以下错误:
I installed SonarQube 6.1 with MSBuild.SonarQube.Runner-2.2.0.24 to analyse a C# solution. When I run an analysis, I get the following error:
当我使用错误消息中建议的-X启动SonarQube扫描仪时,得到以下信息:
When I start the SonarQube Scanner with the -X like it was recommended in the error message, I get this:
2016-11-14T14:33:27.2720044Z ##[error]15:33:27.238 Unrecognized command line argument: -X
2016-11-14T14:33:27.2720044Z ##[error]15:33:27.261 Expecting at least the following command line argument:
2016-11-14T14:33:27.2730045Z ##[error]- SonarQube project key
2016-11-14T14:33:27.2730045Z ##[error]When connecting to a SonarQube server earlier than version 6.1, the following command line arguments are also required:
2016-11-14T14:33:27.2740046Z ##[error]- SonarQube project name
2016-11-14T14:33:27.2740046Z ##[error]- SonarQube project version
2016-11-14T14:33:27.2750047Z ##[error]The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
2016-11-14T14:33:27.2750047Z ##[error]15:33:27.261 Pre-processing failed. Exit code: 1
我通过以下方式启动扫描仪:
I start the scanner with:
SonarQube.Scanner.MSBuild.exe begin /k:ProjectKey /n:ProjectName /v:4.0.70
结束命令是
SonarQube.Scanner.MSBuild.exe end
确定在结束之前调用开始.有什么问题吗?
Start is definively called before end.What could be wrong?
推荐答案
我也遇到了同样的麻烦,这可能是由于未使用UTF-8或启用BOM的UTF-8编码引起的,请参见此处以供参考:
I've stumbled in the same trouble and it could be caused by a not UTF-8 or a BOM enabled UTF-8 encoding, see here for reference:
使用非UTF-8编码分析包含某些C#源文件的Visual Studio解决方案失败
作为可能的等待更新的WA,请尝试将源编码强制为UTF-8,如果还不够,请尝试将源显式转换为无BOM的UTF-8编码.
As a possible WA waiting for a fix, try to force source encoding to UTF-8 and, if not enough, to explicitly convert your sources to BOM-less UTF-8 encoding.
这篇关于SonarQube Scanner执行期间发生错误-非法参数异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!