Question

Any ideas as to how to make this error message go away?

Cannot run process E:\Program Files\Microsoft FxCop 1.36\FxCop.exe\FxCopCmd.exe /forceoutput /gac /ignoregeneratedcode /f:\Sacog\bin\Debug\Sacog.dll /out:05A1B22A-DE6E-49ae-AA30-DC52A074EF22\fxcop-result.xml : file not found

Was it helpful?

Solution

I had to set the following in buildAgent.properties file

system.FxCopRoot=c:\\Program Files (x86)\\Microsoft FxCop 1.36

Make sure to escape the colon and backslashes.

Then I had to create an artifact from my compile build configuration of the bin folder containing the assemblies I wanted FxCop to look at. Then I had to create an artifact dependency on that artifact in the FxCop build configuration; otherwise there were not any assemblies available for FxCop tp operate on.

That did the trick for me.

OTHER TIPS

Have you set "FxCop installation root" setting in the runner configuration?

If you have, please remove FxCop.exe from the end.

If not, could you post here the content of Settings tab from your FxCop build page?

FxCop is attempting to test code at the ROOT of the BuildAgent's drive... the switch

/f:\Sacog\bin\Debug\Sacog.dll

Is trying to get Sacog.dll from the root of that drive. This is probably from the list of files that you have configured in TeamCity for FxCop to analyze. Remove the \ at the beginning of the file name in the "Assemblies" section on the "Build Configuration / Step 3: Runner" configuration screen.

Just add the FXCop path to the PATH environment variable.

Also, NAnt contrib has a fxcop task. Use it like so:

  <loadtasks>
    <fileset basedir="${environment::get-variable('NAntContribHome')}">
      <include name="NAnt.Contrib.Tasks.dll" />
    </fileset>
  </loadtasks>


  <target name="fxCop" depends="compile">
    <fxcop analysisReportFilename="fxCopResults.xml" failOnAnalysisError="false" >
      <targets>
        <includes name="BinaryToAnalyse.dll" />
      </targets>
      <rules>
        <includes name="C:\Program Files\Microsoft FxCop 1.36\Rules\*Rules.dll" />
      </rules>
    </fxcop>
  </target>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top