2

I'm trying to get a post-build event up and running which will get the contents of FxCop warnings/errors into the Error List

This is my post-build event commandline:

"$(ProgramFiles)\Microsoft FxCop 10.0\FxCopCmd.exe" /file:"$(TargetPath)" /console

I've succeeded in that regard, but in the Location column, the errors just say [Location not stored in Pdb], which isn't what I'm looking for. The relevant PDB file is present.

I've implemented the steps here but that is for a previous version of FxCop and it hasn't solved the problem.

I'm using Visual Studio 2010 Professional.

Here is a sample of the Error List window:

Sample Error List output

TIA

enashnash
  • 1,578
  • 1
  • 15
  • 36

1 Answers1

1

Is there a PDB file available for the target assembly in the same folder? If not, you need to generate and/or copy the PDB file so that is available to FxCp.

If you already have a PDB file present in the correct location, it may just be that you're running into rule violations for which there legitimately isn't any source context information in the PDB file. If you're not sure if this is the case, could you please provide an example of a violation for which source context information is absent even though you think it should be available?

Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49
  • There is a PDB file in the same folder as the DLL. I'll update the question with more information. – enashnash Nov 03 '11 at 13:34
  • PDB files only contain source context information for executable code. Interfaces are not executable, so there is no source context information for their members in a PDB file, and the results you have shown in your updated question are to be expected. (Visual Studio Code Analysis can expose source context information for the same violations because it has additional information at its disposable (i.e.: the actual source code) for resolving target contexts that aren't contained in the PDB file.) – Nicole Calinoiu Nov 03 '11 at 14:23