我试图在SonarQube 4.5.1上使用FxCop,但是FxCopCmd失败了。
问题是,当SonarQube创建FxCopCmd调用时,他添加了参数/ aspnet。由于我的程序是Web项目而不是Web站点,因此该参数导致4个分析引用异常:
C:\ Program Files \ Microsoft Fxcop 10.0> FxCopCmd.exe /file:G:\sbs1\workspace\Projeto2\DCX.ITLC.Web\bin\DCX.ITLC.Web.dll / ruleset: = G:\ sbs1 \ workspace \ Projeto2 \ target \ sonar \ projeto2_projeto2_DCX.ITLC.Web \ fxcop-sonarqube.ruleset /out:G:\sbs1\workspace\Projeto2\target\sonar\projeto2_projeto2_DCX.ITLC.Web\fxcop-report .xml / outxsl:none / forceoutput / searchgac / aspnet
Microsoft (R) FxCop Command-Line Tool, Version 10.0 (10.0.30319.1) X86
Copyright (C) Microsoft Corporation, All Rights Reserved.
Loaded designrules.dll...
Loaded globalizationrules.dll...
Loaded interoperabilityrules.dll...
Loaded mobilityrules.dll...
Loaded namingrules.dll...
Loaded performancerules.dll...
Loaded portabilityrules.dll...
Loaded securityrules.dll...
Loaded securitytransparencyrules.dll...
Loaded usagerules.dll...
Loaded DCX.ITLC.Web.dll...
Initializing Introspection engine...
An unhandled exception was encountered during GlobalBeforeAnalysis:
...
Analysis Complete.
* 4 total analysis engine exceptions.
Writing report to G:\sbs1\workspace\Projeto2\target\sonar\projeto2_projeto2_DCX.
ITLC.Web\fxcop-report.xml...
Done:00:00:01.4219205
如果我在没有/ aspnet参数的情况下执行相同的调用,则FxCopCmd运行正常:
C:\ Program Files \ Microsoft Fxcop 10.0> FxCopCmd.exe /file:G:\sbs1\workspace\Projeto2\DCX.ITLC.Web\bin\DCX.ITLC.Web.dll / ruleset: = G:\ sbs1 \ workspace \ Projeto2 \ target \ sonar \ projeto2_projeto2_DCX.ITLC.Web \ fxcop-sonarqube.ruleset /out:G:\sbs1\workspace\Projeto2\target\sonar\projeto2_projeto2_DCX.ITLC.Web\fxcop-report .xml / outxsl:none / forceoutput / searchgac
Microsoft (R) FxCop Command-Line Tool, Version 10.0 (10.0.30319.1) X86
Copyright (C) Microsoft Corporation, All Rights Reserved.
Loaded designrules.dll...
Loaded globalizationrules.dll...
Loaded interoperabilityrules.dll...
Loaded mobilityrules.dll...
Loaded namingrules.dll...
Loaded performancerules.dll...
Loaded portabilityrules.dll...
Loaded securityrules.dll...
Loaded securitytransparencyrules.dll...
Loaded usagerules.dll...
Loaded DCX.ITLC.Web.dll...
Initializing Introspection engine...
Analyzing...
Analysis Complete.
Writing report to G:\sbs1\workspace\Projeto2\target\sonar\projeto2_projeto2_DCX.ITLC.Web\fxcop-report.xml...
Done:00:00:02.2656975
我使用的组件是: - SonarQube 4.5.1 - Visual Studio Projects 1.2的分析引导程序 - C#3.3
我很想找到一种方法来禁用在SonarQube上使用/ aspnet参数。任何帮助将不胜感激。
答案 0 :(得分:0)
确实FxCop 10在/aspnet
切换时遇到了一些麻烦。 FxCop版本12(与Visual Studio 2013捆绑在一起)正确处理该切换。
您所描述的问题是一个已知问题,至今尚未解决,但有一张票:http://jira.codehaus.org/browse/SONARVS-62
在短期内,您可以在FxCopCmd.exe周围创建一个包装器来剥离标记。