Purpose

This is one of the most popular commands to find all callers of one or many methods. To make it easy you do not have to enter the full method declaration and type name at the command line. Instead a query approach is used to select from a set of assemblies a set of types and from there a set of methods which are matched against the respective file, type and method query. Once the exact type reference is resolved you can search with the -in clause a set of assemblies for callers of the previously found methods.

Parameters

-WhousesMethod <typemethodquery> <declaring file/s> -in <using file/s>
or
-wm <typemethodquery> <declaring file/s> -in <using file/s>

Example

Who is using the Stopwatch Seek Method within the .Net Framework?

ApiChange -whousesmethod "Stopwatch(* Start())" $net2dir\System.dll -in $net2 -excel

Excel output

The expression "Stopwatch(* Start())" is a combined type and method query. The first is a type query. It can be a fully qualified type name or only the type name. The match is done case insensitive. It is generally of the form

<Visibility> <ClrType> <TypeName>
  • Visibility can be public | internal
  • ClrType can be class | interface | struct | enum
  • TypeName is the full qualified type name or a partial name or only a namespace query. The string after the last . is treated as the actual type name.

Valid Type Queries are
  • System.Diagnostics.Stopwatch
  • Stopwatch
  • stopwatch
  • stopw*
  • System.*.Stopwatch
  • public class *
...

Last edited Apr 5, 2011 at 8:52 PM by Alois, version 5

Comments

No comments yet.