Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sonarqube vsts任务在.net core 2应用程序的覆盖范围上出现异常_Sonarqube_Azure Devops_Sonarqube Scan_Asp.net Core 2.0_.net Core 2.0 - Fatal编程技术网

Sonarqube vsts任务在.net core 2应用程序的覆盖范围上出现异常

Sonarqube vsts任务在.net core 2应用程序的覆盖范围上出现异常,sonarqube,azure-devops,sonarqube-scan,asp.net-core-2.0,.net-core-2.0,Sonarqube,Azure Devops,Sonarqube Scan,Asp.net Core 2.0,.net Core 2.0,我相信这更多的是一个bug报告,而不是一个支持问题,但也许我可以解决它 我正在构建和测试.net core 2应用程序: vstest步骤配置如下: 生成trx文件和二进制.coverage文件 如果禁用了代码覆盖率复选框,则生成工作。 如果像图中一样启用,则会失败,并出现以下错误: SonarQube Scanner for MSBuild 3.0.2 Default properties file was found at C:\agent\_work\_tasks\SonarQubeS

我相信这更多的是一个bug报告,而不是一个支持问题,但也许我可以解决它

我正在构建和测试.net core 2应用程序:

vstest步骤配置如下:

生成trx文件和二进制.coverage文件

如果禁用了
代码覆盖率
复选框,则生成工作。 如果像图中一样启用,则会失败,并出现以下错误:

SonarQube Scanner for MSBuild 3.0.2
Default properties file was found at C:\agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.0.2\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
Loading analysis properties from C:\agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.0.2\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
Post-processing started.
13:15:00.927  Loading the SonarQube analysis config from C:\agent\_work\3\.sonarqube\conf\SonarQubeAnalysisConfig.xml
13:15:00.927  TeamBuild environment detected
13:15:00.927  Analysis base directory: C:\agent\_work\3\.sonarqube
Build directory: C:\agent\_work\3
Bin directory: C:\agent\_work\3\.sonarqube\bin
Config directory: C:\agent\_work\3\.sonarqube\conf
Output directory: C:\agent\_work\3\.sonarqube\out
Config file: C:\agent\_work\3\.sonarqube\conf\SonarQubeAnalysisConfig.xml
13:15:00.927  Attempting to locate the CodeCoverage.exe tool...
13:15:00.942  Attempting to locate the CodeCoverage.exe tool using setup configuration...
13:15:00.958  Code coverage command line tool: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
13:15:00.958  Fetching code coverage report information from TFS...
13:15:00.958  Attempting to locate a test results (.trx) file...
13:15:00.989  Looking for TRX files in: C:\agent\_work\3\TestResults, C:\agent\_work\3\s\TestResults
13:15:00.989  Located a test results file: C:\agent\_work\3\s\TestResults\XYZBuild_PRODUCT_XYZ_2017-09-29_13_14_52.trx
13:15:00.989  One code coverage attachment was found in the trx file: PRODUCT_XYZ\XYZBuild_PRODUCT_XYZ 2017-09-29 13_14_45.coverage
13:15:00.989  Absolute path to coverage file: C:\agent\_work\3\s\TestResults\XYZBuild_PRODUCT_XYZ_2017-09-29_13_14_52\In\PRODUCT_XYZ\XYZBuild_PRODUCT_XYZ 2017-09-29 13_14_45.coverage
Unhandled Exception: System.ComponentModel.Win32Exception: The directory name is invalid
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at SonarQube.Common.ProcessRunner.Execute(ProcessRunnerArguments runnerArgs)
at SonarQube.TeamBuild.Integration.CoverageReportConverter.ConvertBinaryToXml(String converterExeFilePath, String inputBinaryFilePath, String outputXmlFilePath, ILogger logger)
at SonarQube.TeamBuild.Integration.CoverageReportConverter.ConvertToXml(String inputFilePath, String outputFilePath, ILogger logger)
at SonarQube.TeamBuild.Integration.CoverageReportProcessorBase.ProcessBinaryCodeCoverageReport(String binaryCoverageFilePath)
at SonarQube.TeamBuild.Integration.CoverageReportProcessorBase.ProcessCoverageReports()
at SonarQube.TeamBuild.PostProcessor.CoverageReportProcessor.ProcessCoverageReports()
at SonarQube.TeamBuild.PostProcessor.MSBuildPostProcessor.Execute(String[] args, AnalysisConfig config, ITeamBuildSettings settings)
at SonarQube.Bootstrapper.BootstrapperClass.PostProcess()
at SonarQube.Bootstrapper.BootstrapperClass.Execute()
at SonarQube.Bootstrapper.Program.Execute(String[] args, ILogger logger)
at SonarQube.Bootstrapper.Program.Main(String[] args)
at SonarQube.Old.Bootstrapper.Program.Main(String[] args)
System.Exception: Unexpected exit code received from batch file: 255
Processed: ##vso[task.logissue type=error;]System.Exception: Unexpected exit code received from batch file: 255
   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeBatchScriptCmdlet.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
The build was not triggered by a Pull Request, not processing code analysis comments
Invoke - Get-TaskVariable cmdlet
Variable read: MSBuild.SonarQube.Internal.IncludeFullReport = true
Invoke - Get-TaskVariable cmdlet
Variable read: MSBuild.SonarQube.Internal.ServerVersion =
Calling InvokeGetRestMethod "/api/server/version"
Invoke - Get-TaskVariable cmdlet
Variable read: MSBuild.SonarQube.HostUrl = https://sonarqube.test.domain.com/
Invoke - Get-TaskVariable cmdlet
Variable read: MSBuild.SonarQube.ServerUsername = ********
Invoke - Get-TaskVariable cmdlet
Variable read: MSBuild.SonarQube.ServerPassword =
GET https://sonarqube.test.domain.com/api/server/version with 0-byte payload
received 5-byte response of content type text/html;charset=utf-8
Processed: ##vso[task.setvariable variable=MSBuild.SonarQube.Internal.ServerVersion;]5.6.6
The SonarQube server version is 5.6.6
Waiting on the SonarQube server to finish processing in order to determine the quality gate status.
Invoke - Get-TaskVariable cmdlet
Variable read: Agent.BuildDirectory = C:\agent\_work\3
Could not find the task details file at C:\agent\_work\3\.sonarqube\out\.sonar\report-task.txt
System.Management.Automation.RuntimeException: Cannot determine if the analysis has finished. Possible cause: your SonarQube server version is lower than 5.3 - for more details see https://go.microsoft.com/fwlink/?LinkId=722407 ---> System.Management.Automation.RuntimeException: Cannot determine if the analysis has finished. Possible cause: your SonarQube server version is lower than 5.3 - for more details see https://go.microsoft.com/fwlink/?LinkId=722407
Processed: ##vso[task.logissue type=error;]System.Management.Automation.RuntimeException: Cannot determine if the analysis has finished. Possible cause: your SonarQube server version is lower than 5.3 - for more details see https://go.microsoft.com/fwlink/?LinkId=722407 ---> System.Management.Automation.RuntimeException: Cannot determine if the analysis has finished. Possible cause: your SonarQube server version is lower than 5.3 - for more details see https://go.microsoft.com/fwlink/?LinkId=722407
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
LegacyVSTSPowerShellHost.exe completed with return code: -1.
我尝试使用我认为是扫描仪使用的参数手动调用CodeCoverage.exe工具,它正确地创建了xml文件


最后,我不能在这里创建问题:因此我假设它将从此处重新路由。

因此不是放置错误报告的地方,我不确定您的支持问题是否存在,也属于这里。它也不在github vsts任务中:而且google组的标题似乎建议使用SO…..如果启用代码覆盖,我也有同样的问题。(禁用代码覆盖效果很好)我向SQ Google group()报告了此问题,如果您不想跟进或ping您在那里的体验。仅供参考,我向SonarSource的优先支持部门报告了此问题(不知道我们有优先支持)。我会发布结果,但到目前为止,他们能够重现问题并正在调查。因此,不是放置错误报告的地方,我不确定您的支持问题是否存在,也属于这里。它也不在github vsts任务中:而且google组的标题似乎建议使用SO…..如果启用代码覆盖,我也有同样的问题。(禁用代码覆盖效果很好)我向SQ Google group()报告了此问题,如果您不想跟进或ping您在那里的体验。仅供参考,我向SonarSource的优先支持部门报告了此问题(不知道我们有优先支持)。我将公布结果,但到目前为止,他们能够重现问题并正在调查。