当不使用FxCop项目时,这样做是可行的:
"c:\Program Files\Microsoft FxCop 1.35\fxcopcmd.exe" /file:SiteSeeker.Core\bin\Release\SiteSeeker.Core.dll /file:SiteSeeker.CoreTest\bin\Release\SiteSeeker.CoreTest.dll /file:SiteSeeker.Example\bin\SiteSeeker.Example.dll /file:SiteSeeker.Web.WebForms\bin\Release\SiteSeeker.Web.WebForms.dll /directory:Library\NUnit\bin\net-2.0 /directory:"Library\EPiServer CMS" /directory:"Library\EPiServer CMS\5.1.422.4" /directory:"Library\EPiServer CMS\6.0.530.0" /out:FxCopResults.xml当我有这个FxCop项目时:
<?xml version="1.0" encoding="utf-8"?>
<FxCopProject Version="1.35" Name="SiteSeeker, Release">
<ProjectOptions>
<SharedProject>True</SharedProject>
<Stylesheet Apply="False">http://www.gotdotnet.com/team/fxcop//xsl/1.35/FxCopReport.xsl</Stylesheet>
<SaveMessages>
<Project Status="None" NewOnly="False" />
<Report Status="None" NewOnly="False" />
</SaveMessages>
<ProjectFile Compress="True" DefaultTargetCheck="True" DefaultRuleCheck="True" SaveByRuleGroup="" Deterministic="True" />
<EnableMultithreadedLoad>True</EnableMultithreadedLoad>
<EnableMultithreadedAnalysis>True</EnableMultithreadedAnalysis>
<SourceLookup>True</SourceLookup>
<AnalysisExceptionsThreshold>10</AnalysisExceptionsThreshold>
<RuleExceptionsThreshold>1</RuleExceptionsThreshold>
<Spelling Locale="en-us" />
<VersionAware>False</VersionAware>
<OverrideRuleVisibilities>False</OverrideRuleVisibilities>
<CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" />
<SearchGlobalAssemblyCache>False</SearchGlobalAssemblyCache>
<DeadlockDetectionTimeout>120</DeadlockDetectionTimeout>
</ProjectOptions>
<Targets>
<AssemblyReferenceDirectories>
<Directory>$(ProjectDir)/Library/EPiServer CMS/5.2.375.7/</Directory>
<Directory>$(ProjectDir)/SiteSeeker.Plugin/bin/Release/</Directory>
</AssemblyReferenceDirectories>
<Target Name="$(ProjectDir)/SiteSeeker.Core/bin/Release/SiteSeeker.Core.dll" Analyze="True" AnalyzeAllChildren="True" />
<Target Name="$(ProjectDir)/SiteSeeker.CoreTest/bin/Release/SiteSeeker.CoreTest.dll" Analyze="True" AnalyzeAllChildren="True" />
<Target Name="$(ProjectDir)/SiteSeeker.Example/bin/SiteSeeker.Example.dll" Analyze="True" AnalyzeAllChildren="True" />
<Target Name="$(ProjectDir)/SiteSeeker.Web.WebForms/bin/Release/SiteSeeker.Web.WebForms.dll" Analyze="True" AnalyzeAllChildren="True" />
</Targets>
<Rules>
<RuleFiles>
<RuleFile Name="$(FxCopDir)\Rules\DesignRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\GlobalizationRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\InteroperabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\MobilityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\NamingRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\PerformanceRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\PortabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\SecurityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\UsageRules.dll" Enabled="True" AllRulesEnabled="True" />
</RuleFiles>
<Groups />
<Settings />
</Rules>
<FxCopReport Version="1.35" />
</FxCopProject>并使用以下命令行:
fxcopcmd.exe /project:FxCopRelease.FxCop /out:FxCopResults.xml我得到了这个输出,并且没有编写FxCopResults.xml (它仍然不存在):
>>> fxcopcmd.exe /project:FxCopRelease.FxCop /out:FxCopResults.xml
Microsoft FxCopCmd v1.35.60623.0
Copyright (C) 1999-2006 Microsoft Corp. All rights reserved.
Loading FxCopRelease.FxCop...
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 UsageRules.dll...
Initializing Introspection engine...
Analyzing...
Analysis Complete.
No messages written.
Done.
>>> type FxCopResults.xml
The system cannot find the file specified.如果我使用/console而不是/out,我会得到相同的输出。
首先,FxCop项目文件中充满了错误。我只想要里面的实际设置。所以我改变了..。一些东西..。这可能和这个问题有关。但是,如果它是,在所有可能的情况下,,我仍然想,让我的FxCop项目文件单独使用,并将导致的违规放在的另一个文件中。
发布于 2010-09-09 15:00:37
尝试更改邮件保存设置以将活动邮件保存到报表中。例如:
<SaveMessages>
<Project Status="None" NewOnly="False" />
<Report Status="Active" NewOnly="False" />
</SaveMessages> 发布于 2014-12-09 18:59:39
很久以前我也遇到过类似的问题。我没有把fxcop的结果提交给FxCopResult.xsl,我确实是这样做的,这个问题得到了解决。
'<Stylesheet Apply="False">$(ProjectDir)/../../../program files/microsoft fxcop 1.36/Xml/FxCopReport.xsl</Stylesheet>
<SaveMessages>
<Project Status="Active" NewOnly="False" />
<Report Status="Active" NewOnly="False" />
</SaveMessages>'https://stackoverflow.com/questions/3675549
复制相似问题