为什么SonarQube Scanner for MSBuild无法与MSBuild 15.0一起工作?

5

我最近将我的Visual Studio从2015升级到了2017。

构建过程现在使用MSBuild 15.0,因此我可以使用C#7。

我安装了最新版本6.3的SonarQube服务器,并使用最新版本的C#扫描器2.2.0.24。

我正在尝试对我的代码进行分析,从包含解决方案的文件夹开始:

  1. Run SonarQube.Scanner.MSBuild.exe begin /key:"myproject".

    SonarQube Scanner for MSBuild 2.2
    Default properties file was found at C:\myfolder\SonarQube.Analysis.xml
    Loading analysis properties from C:\myfolder\SonarQube.Analysis.xml
    Pre-processing started.
    Preparing working directories...
    SonarQube Scanner for MSBuild 2.2
    11:21:18.714  Updating build integration targets...
    11:21:18.735  Fetching analysis configuration settings...
    11:21:19.341  Generating rulesets...
    11:21:19.39  Provisioning analyzer assemblies for cs...
    11:21:19.392  Installing required Roslyn analyzers...
    11:21:19.435  Pre-processing succeeded.
    
  2. Run MSBuild version 15.1.548.43366.

    ...
    
    Build succeeded.
        0 Warning(s)
        0 Error(s)
    
  3. Run SonarQube.Scanner.MSBuild.exe end.

    SonarQube Scanner for MSBuild 2.2
    Default properties file was found at C:\myfolder\SonarQube.Analysis.xml
    Loading analysis properties from C:\myfolder\SonarQube.Analysis.xml
    Post-processing started.
    SonarQube Scanner for MSBuild 2.2
    The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
    Possible causes:
    1. The project has not been built - the project must be built in between the begin and end steps
    2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
    3. The begin, build or end steps have not all been launched from the same folder
    Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
    11:22:06.162  Creating a summary markdown file...
    11:22:06.167  Post-processing failed. Exit code: 1
    

我无法弄清楚它为什么失败。

c# SonarQube扫描器2.2是否支持MSBuild 15.0?

1个回答

4

SonarQube Scanner for MSBuild 2.2不支持MSBuild 15。

好消息是,我们即将发布版本为2.3的Scanner for MSBuild,修复此问题。您可以在错误票证SONARMSBRU-288了解更多信息。

该版本将会在2017年4月上旬发布。


好消息!我会等待它的到来 :) - Hemel
你好, 构建成功,但是出现以下错误:未找到可分析的项目。SonarQube分析将不会执行。请检查构建摘要报告。sonar-project.properties文件无法被Sonar Qube扫描器识别。请从以下项目根文件夹中删除文件。后处理失败。请帮我解决这个问题。我是否缺少配置文件? - Ganesh

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接