CorClass Sample

Sample Overview

This sample tool will search assemblies for class names and return summary information about a class if it is found.  It extensively uses the System.Reflection functionality.

By default, the sample only searches the mscorlib assembly.  You must specify the -m option to explicitly load other assemblies to be searched.

The following table shows the command-line options used by the sample.

OptionDescription
-a level Specifies abbreviation level, where level is short, medium, or long.
-w Generates output in HTML format.
-f Shows fully qualified names in output.
-m module Loads and searches the module assembly.
-noinherit Prevents the display of inherited methods and fields.
-o Shows only class names within modules (use with the -m option).
-q Suppresses error output.
-v Displays only output visible (public and protected) classes, methods, or fields.
-p Displays only output public classes, methods, or fields.
 -h Shows usage help.

Sample Source and Build Output Locations

The sample source is found in rotor\samples\utilities\corclass. 

The source files are:

The build output location is %TARGETCOMPLUS%\samples\utilities\corclass. The output file is an executable assembly named corcls.exe.

Building the Sample

All samples are built from the buildall script. 

You can also build all the samples by switching to the root of the sample directory, sscli\samples, and typing build -c.

You can build this specific sample by switching to the sample directory and typing build -c.

Running the Sample

These steps require that the Shared Source CLI (SSCLI) be already built and functional.

  1. Run the env.bat or source the env.csh or env.sh script files depending on your platform.
  2. Switch to the %TARGETCOMPLUS%\samples\utilities\corclass directory.
  3. Type the following command:

    clix corcls classname

where classname is the name of the type for which you are searching.


Copyright (c) 2002 Microsoft Corporation. All rights reserved.