簡體   English   中英

SonarQube無法識別的命令行參數C#

[英]SonarQube unrecognized command line argument c#

我在為我的C#應用​​程序運行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:我正在運行聲納古版本6.7.1和M​​SBuild

您執行的第二個命令應該是msbuild.exe ,而不是SonarQube.Scanner.MSBuild.exe

編輯:

問題的確是我必須執行MSBuild.exe而不是另一個,但是如果您無法執行該程序,則可能是因為您尚未配置環境變量和路徑。 如果無法執行,則只需在“程序文件”(x86)中查找MSBuild文件夾,最后應執行以下操作:

'C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe' /t:Rebuild

所以應該是這樣。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM