Using the Object Browser, I see everything, public, internal, private. How can I see only the public API of my class library?
If not, is there another tool I can use to browse my class library's public API? I'm trying to get an outside-in view of my library.
A class library is a collection of class definitions contained in a . dll or .exe file. In order to use the class library, you must first add a reference to the library (see "How to add references to your Visual Studio Project").
Start Visual Studio Code. In the Open Folder dialog, create a ClassLibraryProjects folder and click Select Folder (Open on macOS). Open the Terminal in Visual Studio Code by selecting View > Terminal from the main menu. The Terminal opens with the command prompt in the ClassLibraryProjects folder.
You can use Reflector and limit the visibility options under 'View' -> 'Options' -> 'Browser' to 'Public items only':
In the object browser to filter only public items on an individual class. This doesn't filter the left hand pane of the browser so you still see private types there.
You can also use the ILDASM tool that ships with the Windows SDK. This gives a bunch more filtering options and filters things from the tree fiew completely. It's really a disassembly viewer to it's not as pretty.
You can download the SDK from here: http://msdn.microsoft.com/en-us/windows/bb980924
It will install in: C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\NETFX 4.0 Tools\ildasm.EXE
You can also use Reflector. This used to be free but now seems to be a paid product that will uninstall the free version when it updates. IMO reflector is the best tool for this but only if you feel like buying it. It starts at $35 for the basic version http://www.reflector.net/.
By referencing the class library in another project, when I view it in that Object Browser, it shows the public API only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With