如何使用SonarQube的C#插件设置的FxCop安装路径 [英] How to set FxCop installation path using SonarQube's C# plugin

查看:864
本文介绍了如何使用SonarQube的C#插件设置的FxCop安装路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图分析使用SonarQube C#.NET插件的C#项目。
从C#3.0的插件,FxCop的自动即使thogh在sonar-project.properties执行sonar.fxcop.mode =跳,所以我安装的FxCop到以下目录。

I'm trying to analyze .NET C# project using SonarQube C# plugin. From C# Plugin 3.0, FxCop is automatically executed even thogh "sonar.fxcop.mode=skip" in sonar-project.properties, so I installed FxCop to following directory.

C:\Program Files (x86)\Microsoft FxCop 1.35

当我从詹金斯的声纳插件跑SonarQube亚军,然后我得到了以下错误

When I ran SonarQube Runner from Jenkins's sonar plugin, then I got following error.

ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: The property "sonar.cs.fxcop.assembly" must be set.
ERROR: 
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILUR



< 。p>我启用了Visual Studio的引导程序上SonarQube,我又跑了SonarQube亚军,然后我得到了以下错误

I enabled Visual Studio Bootstrapper on SonarQube, and I ran SonarQube Runner again, then I got following error.

ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: java.io.IOException: Cannot run program "C:/Program Files (x86)/Microsoft Visual Studio 12.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe": CreateProcess error=2, ?w?????t?@?
ERROR: Caused by: Cannot run program "C:/Program Files (x86)/Microsoft Visual Studio 12.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe": CreateProcess error=2, ?w?????t?@?
ERROR: Caused by: CreateProcess error=2, ?w?????t?@?
ERROR: 
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.



我添加sonar.fxcop.installDirector = C:/ Program Files文件(86)/微软的FxCop 1.35 来sonar-project.properties,并再次运行SonarQube亚军然而同样的错误发生。

I add "sonar.fxcop.installDirector=C:/Program Files (x86)/Microsoft FxCop 1.35" to sonar-project.properties, and ran SonarQube Runner again however same error occured.

我想如果Visual Studio的引导程序禁用sonar-project.properties指定声纳。 cs.fxcop.assembly和sonar.fxcop.installDirector正确,它的工作很好,但我不想指定sonar-project.properties许多属性。

I guess if Visual Studio Bootstrapper disabled and sonar-project.properties specify "sonar.cs.fxcop.assembly" and "sonar.fxcop.installDirector" correctly, It's work fine, but I don't want to specify many properties in sonar-project.properties.

如何设置FxCop的执行路径以使Visual Studio的引导程序

How can I set FxCop execution path with enabling Visual Studio Bootstrapper?

环境:


  • SonarQube4.2

  • SonarQube的C#插件3.0

  • SonarQube亚军2.4

sonar-project.properties

sonar-project.properties

sonar.projectKey=xxxxx
sonar.projectVersion=1.0
sonar.projectName=Project Name

sonar.language=cs
sonar.dotnet.key.generation.strategy=safe
sonar.sourceEncoding=UTF-8

# This property is set because it is required by the SonarQube Runner.
# But it is not taken into account because the location of the source
# code is retrieved from the .sln and .csproj files.
sonar.sources=.
sonar.fxcop.mode=skip
sonar.gendarme.mode=skip
sonar.gallio.mode=skip
sonar.ndeps.mode=skip
sonar.stylecop.mode=skip
sonar.fxcop.installDirector=C:/Program Files (x86)/Microsoft FxCop 1.35

问候

推荐答案

我发现声纳QUBE针对此问题的解决方案,登录作为管理,然后去要设定,在一般设置你找到类别中,选择C#,然后单击代码分析/ FxCop的选项卡,然后找到路径FxCopCMD.Exe,并作为例子

I found the solution for this issue , Login as an administration on sonar qube and then go to setting , under general setting you find Category, select C# then Click on Code Analysis/FxCop tab , then find "Path to FxCopCMD.Exe" and add the full path of FXCopCMD.exe as suggested in example

点击此处,查看图像和处理

这篇关于如何使用SonarQube的C#插件设置的FxCop安装路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆