sonarqube 中的 C# 项目

标签 c# sonarqube

当我运行 sonar-runner 来分析我的简单 C# 项目时,分析因 SonarLint.Runner.exe 上的错误而终止,权限被拒绝:

ERROR: Error during SonarQube Scanner execution
ERROR: java.io.IOException: Cannot run program "/opt/sonarqube-5.4/projects/ArturiCSharpSort/.sonar/SonarLint.Runner/SonarLint.Runner.exe": error=13, Permission denied
ERROR: Caused by: Cannot run program "/opt/sonarqube-5.4/projects/ArturiCSharpSort/.sonar/SonarLint.Runner/SonarLint.Runner.exe": error=13, Permission denied
ERROR: Caused by: error=13, Permission denied

有效

-rw-r--r-- 1 root root 19456 Apr  5 11:14 .sonar/Lint.Runner/SonarLint.Runner.exe

以下是我的 sonar-project.properties:

# Root project information

sonar.projectKey=ArturiCSharpSort

sonar.projectName=ArturiCSharpSort

sonar.projectVersion=1.0

# Some properties that will be inherited by the modules

sonar.sources=.

#List of the module identifiers

#sonar.modules=

# Properties can obviously be overriden for

# each module - just prefix them with the module ID

#module1.sonar.projectName=

#module2.sonar.projectName=

我尝试对 SonarLint.Runner.exe 执行 chmod,但它在每次分析时都会重建。 如何对 C# 项目运行分析?

最佳答案

C#项目的分析必须在Windows环境下进行。这里它失败了,因为该项目是在 Linux 上分析的。

问题是 SonarQube C# Plugin实际上是针对 Windows .NET 生态系统的,您无论如何都可以在其中构建/维护 .NET 项目。它必须与 SonarQube Scanner for MSBuild 一起使用,这需要 MSBuild 14.0。

关于sonarqube 中的 C# 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36503605/

相关文章:

java - Sonar 多模块 Gradle Android 忽略projectBaseDir

permissions - 如何将项目权限授予新用户/组?

c# - 为什么不能通过实例名称访问静态成员?

c# - 找不到蓝牙设备的 ID

c# - Linq 内部的 Linq 导致序列不返回任何结果

c# - Xamarin 表单 - 切换条目 View 的 IsPassword 时出错(仅在 uwp 上)

java - 从我的 java 程序调用 Sonar

c# - 我的实体模型中应该有外键列吗?

java - 遇到 Sonar 错误时如何处理TODO注释

android - 尝试使用 Sonarqube 实现分析时没有发生 Gradle 构建