在TFS构建步骤中缺少用于MS Build 4.0构建步骤的SonarQube

时间:2018-02-09 09:48:09

标签: tfs sonarqube azure-pipelines-build-task sonarqube-msbuild-runner

Sonarqube工作正常,直到我尝试使用Xunit测试扫描一个新项目并得到此错误:

error MSB4062: The "IsTestFileByName" task could not be loaded from the assembly C:\temp\ConsoleApp2017\.sonarqube\bin\SonarQube.Integration.Tasks.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0 

根据https://jira.sonarsource.com/browse/SONARMSBRU-310

似乎我们需要在tfs中将SonbuQube Scanner for MSBuild升级到v4.0。 https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube#overview

我们做了什么,升级经过了安装,但我们没有看到新扫描仪的任何新构建步骤,它仍然显示为 版本:3.0.0

我们正在使用:

Java 8 on both SonarQube server and scanner
SonarQube Version 6.2
SonarQube Scanner for MSBuild 3.0
Sonar C# 6.1.0.2359
MSBuild 15.0
TFS Version 14.114.26403.0

尝试重新启动tfs服务器,但没有运气。

1 个答案:

答案 0 :(得分:0)

尝试使用版本4 ,如Fabrice所说:

此外,您可以参考this link获取 SonarQube Scanner for MSBuild 4.0。

enter image description here