在 Team City 中将 FxCop 作为构建步骤运行时出现以下错误:* 未执行分析;必须至少指定一个有效的规则程序集和一个有效的目标文件。但是,所有规则 Dll 都已加载。这是错误日志:
[23:39:07][Step 5/5] Used custom FxCop home directory
[23:39:07][Step 5/5] Starting: "C:\Program Files (x86)\Microsoft Fxcop 10.0\FxCopCmd.exe"
/forceoutput /gac /ignoregeneratedcode "/project:branches/PaninRoot/LatestCode/TechnicalHelp/Panin List Of Rules.FxCop"
/out:C:\BuildAgent\temp\buildTmp\fxcop-output-829310073154064004\fxcop-result.xml
[23:39:07][Step 5/5] in directory: C:\BuildAgent\work\39c68aea6b50c527
[23:39:09][Step 5/5] Microsoft (R) FxCop Command-Line Tool, Version 10.0 (10.0.30319.1) X86
[23:39:09][Step 5/5] Copyright (C) Microsoft Corporation, All Rights Reserved.
[23:39:09][Step 5/5]
[23:39:09][Step 5/5] Loading branches/PaninRoot/LatestCode/TechnicalHelp/Panin List Of Rules.FxCop...
[23:39:09][Step 5/5] Loaded DesignRules.dll...
[23:39:10][Step 5/5] Loaded NamingRules.dll...
[23:39:10][Step 5/5] Loaded PerformanceRules.dll...
[23:39:10][Step5/5] Loaded SecurityRules.dll...
[23:39:10][Step 5/5] Loaded UsageRules.dll...
[23:39:10][Step 5/5] * Analysis was not performed; at least one valid rules assembly and one valid
[23:39:10][Step 5/5] target file must be specified.
[23:39:10][Step 5/5] * 1 total analysis engine exceptions.
[23:39:11][Step 5/5] Writing report toC:\BuildAgent\temp\buildTmp\fxcop-output-829310073154064004\fxcop-result.xml...
[23:39:11][Step 5/5] Done:00:00:03.1101779
[23:39:11][Step 5/5] Process exited with code 1
[23:39:11][Step 5/5] FxCop return code (1): ANALYSIS_ERROR
[23:39:11][Step 5/5] Analysis errors ignored as 'Fail on analysis errors' option unchecked
[23:39:11][Step 5/5] Publishing artifacts
[23:39:11][Publishing artifacts] Collecting files to publish[C:\BuildAgent\temp\buildTmp\fxcop-output-829310073154064004\fxcopresult.xml=>.teamcity/FxCop/]
[23:39:11][Publishing artifacts] Sending C:/BuildAgent/temp/buildTmp/fxcop-output-829310073154064004/fxcop-result.xml
[23:39:11][Step 5/5] Importing inspection results
[23:39:11][Step 5/5] FxCop error: Keyword=CA0052 Kind=Engine Type=Microsoft.FxCop.Sdk.FxCopException No targets were selected.
[23:39:11][Step 5/5] Skipped html report generation since not requested
[23:39:11]Publishing internal artifacts
[23:39:11][Publishing internal artifacts] Sending build.finish.properties.gz file
[23:39:11]Total:0(+0 -0)Errors: 0(+0 -0)
[23:39:11]Build finished