Search code examples
.netfortify

Fortify not finding .NET assemblies


I am trying to setup a Fortify scan, but it keeps giving me errors like this:

Cannot locate class 'System.Object' in the given search path and the Microsoft .NET Framework libraries

I have added the .NET assembly locations to the command line, but it still fails.

Any ideas?


Solution

  • Fortify tries to locate the .NET assemblies and cache them. It looks for Visual Studio in the Windows registry to find what .NET version it should use.

    You need to use -vsversion to specify the version of Visual Studio that was used in creating the .NET code:

    • VS2005 = 8.0

    • VS2008 = 9.0

    • VS2010 = 10.0

    • VS2012 = 11.0

    • VS2013 = 12.0

    • VS2015 = 14.0

    If that does not do it, use:

    -Dvs.<VS Ver w/o the .>.dotnet.clr.version=<CLR version>
    

    For example, VS2012:

    sourceanalyzer -b MyProj -vsversion 11.0 <your translation args>
    

    or:

    sourceanalyzer -b MyProj -vsversion 11.0 -Dvs.110.dotnet.clr.version=v4.0.30319
    

    Here are all the VS "fallback" args:

    -Dvs.110.dotnet.clr.version=v4.0.30319
    -Dvs.100.dotnet.clr.version=v4.0.30319
    -Dvs.90.dotnet.clr.version=v2.0.50727
    -Dvs.80.dotnet.clr.version=v2.0.50727
    -Dvs.71.dotnet.clr.version=v2.0.50727