SonarQube无法识别的命令行参数c#

时间:2018-01-25 22:20:52

标签: c# sonarqube

我在为我的c#app运行scann时遇到问题,我正在尝试扫描一个简单的控制台应用程序。但每次我进行分析时都会得到这个:

16:00:04.919 16:00:04.919无法识别的命令行参数:/ t:Rebuild

所以这是从一开始就完成的命令:

PS C:\Users\danie\documents\Visual Studio 2015\Projects\ConsoleApplication1> C:\SonarQube-Scanner-for-MSBuild\SonarQube.Scanner.MSBuild.exe begin /k:"ConsoleApplication1" /n:"ConsoleApplication1"/v:"1.0"
SonarQube Scanner for MSBuild 4.0.2
Default properties file was found at C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
16:13:12.659  Updating build integration targets...
16:13:12.674  Fetching analysis configuration settings...
16:13:13.051  Provisioning analyzer assemblies for cs...
16:13:13.052  Installing required Roslyn analyzers...
16:13:13.152  Pre-processing succeeded.
PS C:\Users\danie\documents\Visual Studio 2015\Projects\ConsoleApplication1> 
C:\SonarQube-Scanner-for-MSBuild\SonarQube.Scanner.MSBuild.exe /t:Rebuild
SonarQube Scanner for MSBuild 4.0.2
Default properties file was found at C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
WARNING: Please specify the command 'begin' or 'end' to indicate whether 
pre- or post-processing is required. These parameters will become mandatory 
in a later release.
Pre-processing started.
Preparing working directories...
16:13:17.069  16:13:17.053  Unrecognized command line argument: /t:Rebuild
16:13:17.069  16:13:17.053  A required argument is missing: /key:[SonarQube 
project key]
16:13:17.069  Expecting at least the following command line argument:
- SonarQube project key
When connecting to a SonarQube server earlier than version 6.1, the following command line arguments are also required:
- SonarQube project name
- SonarQube project version
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.

Use '/?' or '/h' to see the help message.
16:13:17.084  Pre-processing failed. Exit code: 1

任何有助于解决这个问题的人都会感激不尽!

感谢。

PD:我正在运行sonarqube版本6.7.1和M​​SBuild

1 个答案:

答案 0 :(得分:0)

您执行的第二个命令应该只是angular.module("myApp") .controller('MyCtrl', function ($scope,getCategoriesService) { getCategoriesService.getCategories().then((function (d) { $scope.resultCategory = d; } }); ,而不是msbuild.exe

编辑:

问题,确实是我必须执行MSBuild.exe而不是另一个,但是如果你不能执行它,可能是因为你没有配置你的环境可变的和路径。如果你不能执行它,只需在Program Files(x86)中查找你的MSBuild文件夹,最后你应该执行它:

SonarQube.Scanner.MSBuild.exe

所以这应该是它。