Why are SPDisposeCheck, CAT.NET or FxCop not recognized?

This article explains why SPDisposeCheck, CAT.NET or FxCop may not be recognized and what you must do to make them recognized by SPCAF if they are installed.

There are several reasons why SPDisposeCheck, CAT.NET or FXCop are not recognized by SPCAF. Below are the main causes, ways on checking if it is the cause and of course how to rectify:

Features for SPCAF may not be installed

During installation of SPCAF, it is possible to disable the installation of the CAT.NET or SPDisposeCheck integration. You can check if you have the required assemblies (SPCAF.Integration.CATNET.dll, SPCAF.Integration.SPDisposeCheck.dll or SPCAF.Integration.FxCop.dll ) in the installation directory of SPCAF (C:\Program Files (x86)\SPCAF by default).

If not, reinstall SPCAF and choose the "Repair" option. In the features selection dialogue check that both tools are enabled for installation.

Features are installed but disabled in the ruleset

SPCAF uses ruleset's to enable or disable certain rules. For instance in ruleset "Minimal Recommended Rules" the SPDisposeCheck is disabled.

Please use ruleset "AllRules" to check if this is the reason or create your custom ruleset with the settings editor.

SPDisposeCheck.exe, CAT.NET.exe or FxCopCmd.exe cannot be found

SPCAF searches for both tools at the typical installation location.
For example, for CAT.NET it searches in the folder C:\Program Files\Microsoft\CAT.NET\CATNETCmd.exe.
If the tools cannot be found at the expected locations, there will be an error message in the report at the bottom in the section "Exceptions".

If you installed the tools in a different location, you can use the SPCAF ruleset to set the path to the executable. Use the settings editor, choose the integration rule and add a config value, to the full file path to the executable file, using the following Keys:

  • CATNETExecutable.
  • SPDisposeCheckExecutable.
  • FxCopExecutable.

Note: All rules of SPDisposeCheck are also provided directly by SPCAF because SPDisposeCheck cannot analyze assemblies for SP2013.