首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使FxCop项目在使用fxcopcmd.exe运行时输出XML文件(它没有输出任何有用的东西)

使FxCop项目在使用fxcopcmd.exe运行时输出XML文件(它没有输出任何有用的东西)
EN

Stack Overflow用户
提问于 2010-09-09 10:01:00
回答 2查看 2.4K关注 0票数 0

当不使用FxCop项目时,这样做是可行的:

代码语言:javascript
复制
"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项目时:

代码语言:javascript
复制
<?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>

并使用以下命令行:

代码语言:javascript
复制
fxcopcmd.exe /project:FxCopRelease.FxCop /out:FxCopResults.xml

我得到了这个输出,并且没有编写FxCopResults.xml (它仍然不存在):

代码语言:javascript
复制
>>> 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项目文件单独使用,并将导致的违规放在的另一个文件中。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-09-09 15:00:37

尝试更改邮件保存设置以将活动邮件保存到报表中。例如:

代码语言:javascript
复制
  <SaveMessages> 
     <Project Status="None" NewOnly="False" /> 
     <Report Status="Active" NewOnly="False" /> 
  </SaveMessages> 
票数 3
EN

Stack Overflow用户

发布于 2014-12-09 18:59:39

很久以前我也遇到过类似的问题。我没有把fxcop的结果提交给FxCopResult.xsl,我确实是这样做的,这个问题得到了解决。

代码语言:javascript
复制
'<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>'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3675549

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档