【问题标题】:Why SonarQube Scanner for MSBuild does not work with MSBuild 15.0?为什么 MSBuild 的 SonarQube 扫描仪不适用于 MSBuild 15.0?
【发布时间】:2017-08-28 02:51:36
【问题描述】:

我最近将我的 Visual Studio 从 2015 年升级到 2017 年。 构建过程现在使用 MSBuild 15.0,因此我可以使用 C#7。

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

我正在尝试从我的解决方案所在的文件夹中分析我的代码:

  1. 运行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. 运行 MSBuild 版本 15.1.548.43366。

    ...
    
    Build succeeded.
        0 Warning(s)
        0 Error(s)
    
  3. 运行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?

【问题讨论】:

    标签: c# msbuild sonarqube sonarqube-scan


    【解决方案1】:

    SonarQube Scanner for MSBuild 2.2 不支持 MSBuild 15。

    好消息是我们即将发布 2.3 版 Scanner for MSBuild 来修复此错误。你可以阅读更多关于 bug 票 SONARMSBRU-288.

    该版本将于 2017 年 4 月上半月发布。

    【讨论】:

    • 好消息!我会等它:)
    • 您好,构建成功,但出现以下错误,未找到可分析的项目。将不会执行 SonarQube 分析。检查构建摘要报告。用于 MSBuild 的声纳 Qube 扫描仪无法识别 sonar-project.properties 文件。从以下项目根文件夹中删除文件。后处理失败。请帮我解决这个问题。我缺少任何配置文件??
    猜你喜欢
    • 2018-05-12
    • 2017-04-27
    • 2017-04-27
    • 2017-03-24
    • 2018-07-04
    • 2017-10-17
    • 2017-08-17
    • 2018-01-04
    • 2018-03-17
    相关资源
    最近更新 更多