title: 513 Error Code (exit code) FxCop using C#
body: <p>I have VS2010, Windows 7 bits, FxCop 10.0</p>
  
  <p>I execute Fxcopcmd.exe using Process.Start, and I get 513 <strong>"exitcode"</strong> (error code) value.</p>
  
  <p>Todd King in below reference says:</p>
  
  <blockquote>
    <p>In this case an exit code of 513 means FxCop had an Analysis Error
    (0x01) and an assembly references error (0x200)</p>
  </blockquote>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/1191af28-d262-4e4f-95d9-73b682c2044c/" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/1191af28-d262-4e4f-95d9-73b682c2044c/</a></p>
  
  <p>I think if it is like </p>
  
  <pre><code>    [Flags]
      public enum FxCopErrorCodes
      {
          NoErrors = 0x0,
          AnalysisError = 0x1,  // -fatalerror
          RuleExceptions = 0x2,
          ProjectLoadError = 0x4,
          AssemblyLoadError = 0x8,
          RuleLibraryLoadError = 0x10,
          ImportReportLoadError = 0x20,
          OutputError = 0x40,
          CommandlineSwitchError = 0x80,
          InitializationError = 0x100,
          AssemblyReferencesError = 0x200,
          BuildBreakingMessage = 0x400,
          UnknownError = 0x1000000,
      }
  </code></pre>
  
  <p>513 integer value is 0x201 (view <a href="https://stackoverflow.com/questions/4690480/int-to-hex-string">int to hex string</a> and <a href="https://stackoverflow.com/questions/8242875/enum-parse-fails-to-cast-string">Enum.Parse fails to cast string</a> )</p>
  
  <p>How can I know errors (Analysis Error (0x01) and an assembly references error (0x200)) programmatically using only exitcode (513 , 0x201) value ?</p>
  
  <p>More about Error Codes for FxCopCmd and Code Analysis:</p>
  
  <ul>
  <li><a href="http://msdn2.microsoft.com/en-us/library/bb164705(VS.80).aspx" rel="nofollow noreferrer">http://msdn2.microsoft.com/en-us/library/bb164705(VS.80).aspx</a></li>
  <li><a href="http://msdn2.microsoft.com/en-us/library/ms245349(VS.80).aspx" rel="nofollow noreferrer">http://msdn2.microsoft.com/en-us/library/ms245349(VS.80).aspx</a></li>
  </ul>