Can I view the public API of my class library in Visual Studio?

Using the Object Browser, I see everything publicly available, internal, personal. How can I see only the open API of my class library?

If not, is there another tool I can use to view the public class library API? I am trying to get an look in relation to my library.

+6
visual-studio-2010
source share
4 answers

Referring to the class library in another project, when I view it in this object browser, it only shows the open API.

+1
source share

You can use the Reflector and restrict the visibility in the "View" → "Options", → "Browser" to "Only public goods":

enter image description here

+5
source share

In Object Explorer, to filter only public items in a separate class. This does not filter the left pane of the browser, so you still see private types.

Object browser filtering

You can also use the ILDASM tool that comes with the Windows SDK. This gives you more filtering options and completely filters objects from the tree. It really is a disassembly tool, it is not so pretty.

ILDASM

You can download the SDK from here: http://msdn.microsoft.com/en-us/windows/bb980924

It will be installed in: C: \ Program Files \ Microsoft SDK \ Windows \ v7.1 \ bin \ NETFX 4.0 Tools \ ildasm.EXE

You can also use Reflector. It used to be free, but now it's a paid product that will remove the free version when it is updated. IMO Reflector is the best tool for this, but only if you want to buy it. It starts at $ 35 for the basic version of http://www.reflector.net/ .

+4
source share

ApiChange tool allows you to query on the command line and export the results to Excel . For example.

ApiChange.exe -wt "public class *" <YourDll.dll> -in gac:\system.dll -excel 

This will search for all open classes in your DLL and search for users of your types in system.dll. They will not be, but you will get a complete list of all your classes.

The format of the type request is determined by: Visibility ClrType TypeName

  • Visibility May Be Public | internal
  • ClrType may be a class | interface | struct | transfer
  • TypeName is a fully qualified type name or an incomplete name, or just a namespace query. A string after the last. treated as the actual type name.

Valid type queries

  • System.Diagnostics.Stopwatch
  • Stopwatch
  • Stopwatch
  • stopw *
  • System. *. Stopwatch
  • open class *

Regards, Alois Kraus

+1
source share

All Articles