“Cannot locate class…” Errors

Question

How do I resolve issues reported by the Fortify scan of the form:

“Cannot locate class… in the given search path and the Microsoft .NET Framework libraries.”

Answer

This error is typically caused by Fortify not being able to locate the DLLs containing those resources.

This issue may be resolved by setting the -libdirs option to indicate the directories where those DLLs are located. is a semi-colon separated list of paths to folders or DLLs that provide the missing resources. If working from the command line this option may be added directly to the call to sourceanalyzer.

If working within the Visual Studio plugin this option may be added by:

  • Select the Fortify->Options menu item
  • Select “Project Settings”
  • Select the “Enable Project Specific Settings” checkbox
  • Click on the “Advanced Scan Options” Tab
  • Select the “Use additional SCA arguments” checkbox
  • Enter the -libdirs <dirs> option in the “Translate” text box

For example, see the sample options dialog below:

Leave wizard guide settings at default values

References

Fortify documentation