tags:

views:

15

answers:

1

Hi!

When not using an FxCop project, this works:

"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

When I have this FxCop project:

<?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&lt;/Stylesheet&gt;
  <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>

And use this command line:

fxcopcmd.exe /project:FxCopRelease.FxCop /out:FxCopResults.xml

I get this output and no FxCopResults.xml is written (it still does not exist):

>>> 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.

I get the same output if I use /console instead of /out.

At first the FxCop project file got filled with errors. And I only wanted the actual settings in there. So I changed... something.. It might have to do with this problem. But if it is at all possible I still would like to leave my FxCop project file alone and put the resulting violations in another file.

+1  A: 

Try changing the message saving settings to save active messages to the report. e.g.:

  <SaveMessages> 
     <Project Status="None" NewOnly="False" /> 
     <Report Status="Active" NewOnly="False" /> 
  </SaveMessages> 
Nicole Calinoiu